I'm building an application, part of which requires saving out approx 120 000 records on a regular basis.
The client calls a session bean that loops to create instances of CMP ejb's. For the purpose of fixing my problem, I've simplified the EJB to have no CMRs and a few fields. System.gc() is run to reclaim anything available before and after the method call.
Realising that I have limits to VM heap size, I started by testing in batches/transactions of 10 000 .
The first 2 batches run OK (although free memory decreases during each batch), the third starts to slow down the server as, I guess, either jboss or the VM try to reclaim memory and eventually results in an OutOfMemory EJBException.
I initially used the "Standard CMP 2.x EntityBean" container configuration for the entity bean and then extended it trying commit-options A,B,C and D to no effect and varying cache-policy-conf values as well.
Is it reasonable to expect the garbage collector to return all unused objects and to have the same memory avaliable after this simple transaction as was available prior to the transaction( with possibly a small/configurable - max-bean-age, overager-period - time-lag as objects are removed from cache)? I cannot get this to happen.
I'm using jboss 3.2.2. Java HotSpot 1.4.2 VM and mySQL on Windows 2000
Any hints/tips/observations would be greatly appreciated.