Dear Hibernate Gurus,
I write desktop standalone application and due of tight memory requirements I want to unload hibernate and related classes from memory when they are not necessary(application IDLE period).
I isolate all DB classes into separate class loader, split into several independent jar files, and create hibernate instances dynamically. But after I release everything(or I think that everything) hibernate classes still sit in memory.
I dig with jmap and jhat and some other heap analyze tools, but can't catch who keep this loader.
I search this forum and found some similar topics, but they are not exactly the same(mostly for webapps) I need and resolution is not clear to me.
From my point of view usage class loader usage looks clear, maybe there are some Hibernate specific which I am missed so I will really appreciate for any help to solve this problem.
I isolate work with DB into small Eclipse project
http://zuban.com.ua/hib/SampleApp.zip
In this project I
* initialize session factory
* open session
* close session
* release session factory
* unregister drivers
* reset logger factory for class loader
* release class loader
* shutdown working thread
* GC couple of times
But... classes still in the memory