Discussions

I'm using a Stateful Session bean to query a database. The data retrieved will be set into a class instance and this instance is added to a vector. When all the data has been retrieved, the vector is returned to the client. After the vector is return I call the remove() method. However, the amout of memory used when the bean is ivoked does not seem to reduce in any capacity. I have noticed that the amount of memory does increase whrn the bean is invoked using the create() method.

I was wondering if anyone could give me some advice on why this would be hapenning and if it is normal?

Does this problem ultimately cause your server to crash because of low memory? If it does, then you do have a problem, and I can't guess what it is without the related source code. However, you should remember that Java uses a garbage collector to release memory. If the VM is not running very low on memory, the garbage collector may not run for quite some time. This can create the illusion of a memory run, but is actually quite harmless.
My advise to you is, run many requests to the session bean, and see whether or not the server eventually crashes or becomes unreasonably slow. If it doesn't, chances are you're OK.

TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations technology projects - with its network of technology-specific websites, events and online magazines.