-
1. Re: possible memory leak in dev mode with errai
csa Dec 14, 2012 2:47 PM (in response to mojoo)Hi,
After looking into this we fixed a memory leak that occurs when using Errai's UiBinder module. Are you using this by any chance? If so, updating to the latest 2.2.0-SNAPSHOTs should fix (or at least significantly improve) the problem.
Here's the JIRA:
https://issues.jboss.org/browse/ERRAI-456
Cheers,
Christian
-
2. Re: possible memory leak in dev mode with errai
mojoo Dec 18, 2012 4:17 AM (in response to csa)No not using this, tried anyway but didnt helped. thanks for the quick response
-
3. Re: possible memory leak in dev mode with errai
csa Dec 18, 2012 8:21 AM (in response to mojoo)OK thanks for letting us know. To see if there's a memory leak in Errai involved in your case, you could compare heapdumps before and after a DevMode referesh and investigate the instance counts of e.g. org.jboss.errai.codegen.meta.impl.gwt.GWTClass. Of course, the number of instances should be fairly stable between refreshes.
-
4. Re: possible memory leak in dev mode with errai
mojoo Dec 18, 2012 11:28 AM (in response to csa)hello i had a quick look into some dumps and it seams like its mostly instances from class org.jboss.errai.codegen.meta.impl.java.JavaReflectionClass growning:
startup: org.jboss.errai.codegen.meta.impl.java.JavaReflectionClass -- > Number of Objects: 2.244 | Used Heap Size: 233.376 | Retained Heap Size: 990.732.528
after 1st refresh: org.jboss.errai.codegen.meta.impl.java.JavaReflectionClass -- > Number of Objects: 3.380 | Used Heap Size: 351.520 | Retained Heap Size: 1.964.939.208
-
5. Re: possible memory leak in dev mode with errai
csa Dec 18, 2012 11:50 AM (in response to mojoo)1 of 1 people found this helpfulok that's interesting but ~3000 JavaReflectionClass instances only consume about 0.3% of the heap in my case. so, there must be something else involved. if I perform a GC after a DevMode refresh and before I produce a new heapdump, the JavaReflectionClass instance count stays stable (using the latest snapshots and after the first refresh). does the instance count keep growing in your app?
cheers,
christian
-
6. Re: possible memory leak in dev mode with errai
mojoo Dec 19, 2012 6:08 AM (in response to csa)hello again,
i made a mistake in my measurements. i dumped the heaps without calling the gc first. i run the tests again with this setup:
start codeserver
wait for load
call gc via jconsole
take dump
hit reload
wait for load
call gc via jconsole
take dump
and so on
the results are different now. i cant see an increase of JavaReflectionClass instance after the 2nd refresh. biggest increase i found in the Accumulated Objects by Class report was:
-------------------------------------------------------------------------------------------------
0 refresh
java.lang.Class --> Number of Objects: 5.959 Used Heap Size: 27.944 Retained Heap Size: 9.126.632
Class Name org.jboss.errai.codegen.literal.LiteralFactory @ 0x761b00d80 | Retained Heap 267.128
-------------------------------------------------------------------------------------------------
1 refresh
java.lang.Class --> Number of Objects: 5.980 Used Heap Size: 27.944 Retained Heap Size: 9.363.936
Class Name org.jboss.errai.codegen.literal.LiteralFactory @ 0x761b00c38 | Retained Heap 356.280
-------------------------------------------------------------------------------------------------
2 refresh
java.lang.Class --> Number of Objects: 5.981 Used Heap Size: 27.944 Retained Heap Size: 74.187.008
Class Name org.jboss.errai.codegen.literal.LiteralFactory @ 0x761b00c38 | Retained Heap 65.069.384
-------------------------------------------------------------------------------------------------
3 refresh
java.lang.Class --> Number of Objects: 5.982 Used Heap Size: 27.944 Retained Heap Size: 139.026.888
Class Name org.jboss.errai.codegen.literal.LiteralFactory @ 0x761b00c38 | Retained Heap 129.798.872
-------------------------------------------------------------------------------------------------
note that i cut down the project to about 10% of the original size to get the dumps.
hope i got it right this time. thanks again. if you need any other information please let me know.
-
7. Re: possible memory leak in dev mode with errai
csa Dec 19, 2012 12:28 PM (in response to mojoo)Hi,
Thanks for following up!
This looks exactly like the problem we fixed in the latest 2.2.0-SNAPSHOTs. Are you sure the jars got updated? The LiteralFactory is holding a literal cache that should not be growing between refreshes. I just tested this and could not reproduce it.
If you can reproduce this with the latest snapshots, could you take a look at the LITERAL_CACHE and see if the number of items in the cache increases and what these values are? You could add a breakpoint in the emtpyCache method in org.jboss.errai.codegen.literal.LiteralFactory to investigate this (this method should be called during every refresh). That would be of enormous help to track down the problem.
Thanks,
Christian
-
8. Re: possible memory leak in dev mode with errai
mojoo Dec 20, 2012 2:47 AM (in response to csa)sorry, i got mixed up in my jars a little :/ looks like the shapshot fixes this and improves the memory footprint a lot. thanks again.
-
9. Re: possible memory leak in dev mode with errai
csa Dec 20, 2012 10:32 AM (in response to mojoo)That's really good news. Thanks for all the feedback!