We have a GWT based application deployed on Tomcat. Every other day the application crashes with OutOfMemoryException. So i have started taking the heap dump of the application when it is close to using maximum allocated memory.
The behavior of application is the following,
- User Logs in to the application
- Enters input to the application which is to be ananlyzed on the server using a cluster setup.
- The client polls the server every 15 seconds for the status of the job and updates the UI controls. The polling is done using requestfactory calls pulling some data from server.
- If the job is done , we display the results to the user using a flextable. There can be around 1000 rows with 6 columns.
Heap Dump,
We took a heap dump of the tomcat process using jmap to see what is holding on to the memory. The following pictures are taken using Eclipse Memory Analyzer with the heap dump.
We can see that there are lots of hashmap entries being kept in the heap with retained size of 25k and there are about 6 million of them.
Questions:
- com.google.gwt.core.client.impl.WeakMapping shows shallow heap of 16 bytes but the retained heap is almost all the memory we allocated for the application.
- Is it because we are polling the server every 15 seconds and retrieving data which is somehow being referenced and not GCed.
- How do we unreference开发者_开发百科 these hashmap.
- Is it anything completely different from the scenarior mentioned here.
We have so far used jconsole, jprofiler, MAT, jhat in analyzing the application. And we have no clue where the issue.
Appreciate your help.
There was a memory leak in WeakMapping
which has been fixed in trunk and the 2.4 branch.
精彩评论