Memory leak in JVM C-heap when using JDBC
Posted in 2007
We have been struggling with out of memory errors for quite some time and the reason for these problems is now found. If you are using JDBC(2.21.JC6 and 3.00.JC3) and handling large objects (BYTE,TEXT, BLOB ocr CLOB data) the JDBC driver uses temporary files to store the data in. Then the method deleteOnExit is used to remove the file. The problem with deleteOnExit is that it keeps data in the C-heap until the JVM is stopped, which is not done frequently in a server. A normal GC will not free the memory, you have to restart the JVM. There are two workarounds, set the LOBCACHE parameter to -1, data is then stored in memory instead of on disk, or restart the JVM often enough to avoid the problem. There is a feature request to change the code so that it does not use deleteOnExit but no plan for when it will be implemented. Ulf