Informix Error -465
-465 No more memory for locator buffer.
This query returns a BYTE or TEXT value that is located in memory, and the locator structure asked (by setting -1 in loc_bufsize) that the database server allocate the memory. It was unable to get the necessary memory for a buffer. If you can use operating-system methods to allocate more data space memory to your program, do so and run it again. Alternatively, locate the value in a file, or use a substring to select the value in portions. If this is a 4GL program, this error should not occur. On DOS systems, exit to the operating-system command line, free some disk space, and resubmit your program. If the error recurs, note all circumstances and contact IBM Informix Technical Support.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-465 fires when a BYTE/TEXT value's locator requests automatic memory allocation
(loc_bufsize set to -1, meaning "allocate exactly enough") but the server can't obtain
sufficient memory for the buffer — typically because the value itself is very large, or because
overall available memory is constrained at the time.
- A genuinely very large blob value that exceeds what can be allocated in the current memory environment.
- Constrained available data space memory at the time of the request, even for a blob value that would normally fit.
- Memory fragmentation or pressure from other concurrent activity limiting the largest available contiguous allocation.
Solutions / Resolution
- Increase available data space memory, per the official guidance, if the environment allows for it.
- Locate the value in a file instead of memory, per the official guidance — this avoids the in-memory buffer allocation entirely.
- Use a substring to retrieve the value in portions, per the official guidance, if only part of the blob is actually needed, or to process it incrementally rather than all at once.
- On DOS systems specifically, free disk space before resubmitting the program, per the official guidance.
Examples
Locating in a file instead of memory
loc_t my_loc;
memset(&my_loc, 0, sizeof(my_loc));
my_loc.loc_loctype = LOCFNAME;
my_loc.loc_fname = "/tmp/blob_output";
/* avoids the in-memory buffer allocation for a large value */
Retrieving a portion via substring
SELECT description[1,1000] FROM documents WHERE doc_id = 1001;
-- retrieves only the first 1000 bytes, avoiding a full
-- large-value memory allocation
Diagnostic Checks
- Check the actual size of the blob value being retrieved.
- Check available memory on the server/client at the time of the failure.
- Consider whether a file-based or substring-based approach is more appropriate than a fully in-memory retrieval for this data.
Related Errors / Related Topics
- -451 — "Locator buffer size too small." A related locator-buffer error, about an explicitly-sized buffer being too small rather than automatic allocation failing outright.
- -406 — "Memory allocation failed." A related, more general memory-exhaustion error, in a broader context than this locator-specific scenario.
Switch to a file-based locator or a substring-based partial retrieval for genuinely large blob values, rather than relying on automatic in-memory allocation to always succeed.