开发者

Profiling a GWT application for finding Memory leak

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,

  1. User Logs in to the application
  2. Enters input to the application which is to be ananlyzed on the server using a cluster setup.
  3. 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.
  4. 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.

Profiling a GWT application for finding Memory leak

Profiling a GWT application for finding Memory leak

Profiling a GWT application for finding Memory leak

Profiling a GWT application for finding Memory leak

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:

  1. 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.
  2. Is it because we are polling the server every 15 seconds and retrieving data which is somehow being referenced and not GCed.
  3. How do we unreference开发者_开发百科 these hashmap.
  4. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜