Informix Error -1113
-1113 Memory allocation error.
A BYTE or TEXT variable has been located in memory, and a value has been assigned to the variable. However, not enough data memory is available to hold the variable. Review the program, and locate the large value in a file instead.
For 4GL programs, -1319 replaces this error.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1113 fires when a BYTE or TEXT variable, located in memory, is assigned a value larger than
the available data memory can hold — per the official guidance, -1319 is the equivalent error
for 4GL programs specifically.
- A
BYTE/TEXTvalue assigned that's larger than available data memory, per the official guidance — the direct, only cause. BYTE/TEXTdata kept entirely in memory rather than in a file, a design choice that scales poorly as the data involved grows.
Solutions / Resolution
- Store large
BYTE/TEXTvalues in a file instead of memory, per the official guidance — this is the documented fix, avoiding the in-memory size limit entirely. - Review the program for where the oversized value is being assigned, to confirm which
BYTE/TEXTvariable and value are responsible.
Examples
Storing large data in a file instead
/* ESQL/C: reference a large TEXT/BYTE value via a file locator instead
of holding it entirely in memory */
loc_t doc_loc;
doc_loc.loc_loctype = LOCFNAME;
doc_loc.loc_fname = "large_document.txt";
doc_loc.loc_oflags = LOC_RONLY;
EXEC SQL INSERT INTO documents (id, content) VALUES (1, :doc_loc);
Diagnostic Checks
- Identify which
BYTE/TEXTvariable and assignment triggered the error, and consider moving that data to a file-based approach instead of in-memory storage.
Related Errors / Related Topics
- -1319 — The 4GL-program equivalent of this same memory-allocation limit for
BYTE/TEXTvariables.
A BYTE/TEXT value too large for available memory — store it in a file instead (see -1319 for
the 4GL-program equivalent).