-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi ,
in my j2ee application I am facing issue with memory leak.
I did profiling of the project and it seems its the issue with ZK or our usage of ZK.
I see lot of Hashmap and Map.Entry objects in the heap. (261 MB)
Around 232MB of int[] and 129 MB of char[].
We have a smile application with tabs.
On the select of the tab we are attaching the source.
if (inc.getSrc() == null) { inc.setSrc("/zul/1.zul"); } else { MyComposer myComposer = (MyComposer) tabBox.getAttribute("myComposer"); myComposer.refeshList(); }
And in the composer classes we have different methods which are dealing with dbs.
I am on tab1 and then going to tab2, ....tabN. Memory usage is going heigher and heigher. I am not sure what's the issue here.
In our composer classes we have overridden a method :
@Override public void doAfterCompose(Component comp) { super.doAfterCompose(comp); Component tabBoxComponent = comp.getParent().getParent().getParent().getParent(); tabBoxComponent.setAttribute("myComposer", this); }
Can any one suggest what is the issue?
And i go on various tabs, do various operations (not on this tab) but still up gone memory doesn't come down.
Can any one suggest what might be the issue?
Do we need to reclaim the memory used by ZKoss periodically?
Please feel free to ask if something is not clear.
I have attached 2 snaps shots. I am seeing lot of Hasmpa entries are getting created. Hashap and I have taken mark of the memory and the data about the existing objects is here.
Hmmm, i'm not sure about how you deal with tab+composer.
tabBox.getAttribute("myComposer");
Does every tab is controlled by the same ONE composer?
there are many reason that memory is not released.
If I were you , I will try to detach some UI after the memory grow up (add a button to detach tabbox or each tab for test). then check if the memory again.
repeat it on the parent if the memory(objects) still not released.
if the memory was released, you could check you app if it store anything in component attribute
if not, try to remove the desktop,(by close the tab in firefox), check the memory again, then check if any thing you store in desktop attribute.
if not, then try to clear the session(set session timeout shorter), check the memory again after the session was timeout ...
Asked: 2012-03-27 08:34:34 +0800
Seen: 250 times
Last updated: Mar 28 '12