I am using Xceed's compression library to decompress some data. I have written the native code using the DLL API and calling this native code through JNI. The programming model that I'm following is the one dictated here i.e. i initialize the DLL and then create a XceedCompressionObject (although I use the methods XcCreateXceedCompressionA). I use this object to call XcUncompress. Once I have copied the returned decompressed array to the java array, i free the native array returned by XcUncompress using XzFree. Finally I free the XceedCompressionObject with XcDestroyXceedCompression and then shutdown the DLL using XceedZipShutdownDLL.
This whole sequence of calls (DLL initialisation, XcCompressionObject creation, Decompression, MemoryFreeing, XceedCompressionObject destruction and DLLShutdown) is repeated a number of times, once every 100 millisecods or so for 8 - 10 hours. After 8-10 hours the java code that uses the Xceed library over JNI crashes with OutOfMemoryError (I have attached processlog that JVM throws along with this).
I have seen the java code and the profiler shows that the java heap and generations increases and decrease within bounds as they should so I don't think that there is a leak withing the java process. Also, since the method fails in native code, I have a feeling that there is memory leak in the native code.
IsXzFree the right function to use for freeing memory created during decompressing (calling XcUncompress)?
If I am freeing memory correctly what do u think would be the reason for the issue?