Initially to start with, I am seeing memory consumption as 300MB(from weblogic console monitoring) and when I deployed and try accessing this site, memory consumption went up to 450MB. But the memory is not coming back to 300MB and it is staying at 425MB or so even after waiting for a long time after the request(more than 20min).
I think, therefore I exist -- Rene Descartes
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
You referred to Entity Beans - specifically CMP. Don't forget that one of the reasons for using EJBs over lighter-weight persistence object is that the container caches them.
I think, therefore I exist -- Rene Descartes
Create a business method in your bean that returns the map of DTOs rather than maintaining this list in your bean as an instance variable.
Programmatically loop through the list of DTOs and remove them from the list (setting the references to null).
Use soft references. This way the GC will garbage collect the DTOs as more memory is required, although they are not orphans. This of course might have other implications but is worth trying.
Isn't it a normal practice to maintain instance variables and
get/settermethods to access the instance variables in jsp.
When should I do this? There is no logout on the screen. This is a public site.
Should I soft reference the map in the java bean? What are the other
implications?
As Tim pointed out could'nt it be the weblogic entity bean cache that
Is taking up the memory ? ( I mean say a finder that has resulted in huge
number of beans getting loaded in the cache)..
I think, therefore I exist -- Rene Descartes
Consider Paul's rocket mass heater. |