Problem(Abstract)
A java program getting "OutOfMemory" when handling blobs. Informix JDBC Driver uses the java File.deleteOnExit when handling blobs which causes the OutOfMemory problem in the JVM heap.
Resolving the problem
PROBLEM
A java application that uses Informix JDBC Driver to deal with BLOBs runs out of memory. Informix JDBC Driver uses the java File.deleteOnExit which causes the OutOfMemory problem in the JVM heap.
Example of error java.lang.OutOfMemoryError
The heap will have a lot of blocks that contain file names that have names like ifxb_123456 or ifxb_123456890. The shorter file names in JDBC drivers upwards from 2.21.JC6 and 3.00.JC1 and the longer filenames in earlier versions.
CAUSE
Reason for this is a known bug regarding File.deleteOnExit() calls:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4813777
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513817
SOLUTION
To workaround this set the environment variable LOBCACHE to -1.
EXTERNAL REFERENCES
To read more about the environment variable LOBCACHE see the manual "IBM Informix JDBC Driver Programmer’s Guide".
http://www-306.ibm.com/software/data/informix/pubs/library/
http://www-01.ibm.com/support/docview.wss?uid=swg21260832