Don't keep hold of class references in your code.
Typically, these are in supporting jars, usually
in static HashMaps.
I've heard struts 1.0 had this problem and I was
also speaking with somebody recently who had
a similar problem with hibernate.
What exactly do you mean by "holding references". Do you mean just set the variable to null?
What do you do with static variables?
Do you use an explicit close or dispose method?
No, the supporting jar is not in the deployment.
It has something like:
static HashMap map = new HashMap();
somewhere it will do
but never remove it.
I've tried just using an empty mbean in the default jboss server. The mbean is two classes and simply has a start and a stop method. The two methods are empty.
Each time I redeploy this mbean the previous instances are not unloaded. If I profile the application in OptimizeIt it shows lots of versions of the mbean classes loaded in the VM with one instance of the latest version allocated.
JBoss is not unloading classes. Is there a way to fix this?
have tried increasing the stack size?
you can do this by using "-mx512m" for 512M of RAM at the java command line
Ummm, what happens when the memory used exceeds the 512M stack. Set the stack to 1024Mb? What if it goes beyond that? I'm not sure this is a solution.