I have a Java project which works with one dll library via COM. I have Windows 7 and I use 32bit Java 1.6. I use 2012/04/26 release of com4j as a bridge. It works.
The problem is that I have a serious memory leak which makes operation of my program almost impossible.
I have subscribed to some COM events. When the next event arrives I observe the raise of Heap memory used, and GC never helps to decrease it. If I use COM4J.cleanUp() - memory usage stops its growth, but the events no longer arrive. Heap memory used by my program raises very fast, while in fact no my own objects being allocated.
Snapshots difference in VisualVM: http://postimg.org/image/cxg77ft8j/
Heap Memory raise in VisualVM: http://postimg.org/image/m52g63b51/
Looks like the problem is with DirectByteBuffer, Cleaner, Variant and Finalizer instances. I do not create them by myself. This is something inside com4j.
Any suggestions?