-
1. Re: Memory usage is odd
wdfink Aug 16, 2013 11:33 AM (in response to rm0han)How do you "free" the memory?
Maybe this is a JVM problem, do you use an actual JVM version? Did you check whether it is a known JVM issue?
-
2. Re: Memory usage is odd
rm0han Aug 17, 2013 11:43 AM (in response to wdfink)The JVM's are restarted to free the memory. The VM is 1.6.0_33
It seems to be like this thread https://community.jboss.org/thread/146579 but we are not using NIO
The thread https://community.jboss.org/thread/146579 points to this bug http://bugs.sun.com/view_bug.do?bug_id=6735255 which is about closing ZipInputStream. In our code there seems to be heavy usage of blob reads and writes. But not 'ZipInputStream.'
InputStream ins = fileName.getInputStream();
BufferedReader bug = new BufferedReader( new InputStreamReader(ins));
'ins' is not closed at all. Will heap monitoring track this or 'pmap' ?
Thanks.
-
3. Re: Memory usage is odd
wdfink Aug 17, 2013 2:23 PM (in response to rm0han)You need to close the Stream in any case, i.e. by using a finally block.
Otherwise you may run out of filehandles memory or other resources.
-
4. Re: Memory usage is odd
rm0han Aug 18, 2013 2:27 AM (in response to wdfink)I agree. It is the data that is missing and the way to track it at the OS level. At this time there is no proof that it is eating up the memory. 'Used memory' is high on my RHEL.
Update:
I believe I have found the cause. Thousands of such 'anon' blocks in the pmap output. How do I link this back to the InputStream or something else that is causing the leak ?
0000000041fcd000 4 0 0 ----- [ anon ]
0000000041fce000 1024 12 12 rwx-- [ anon ]
00000000420ce000 4 0 0 ----- [ anon ]
00000000420cf000 1024 12 12 rwx-- [ anon ]
00000000421cf000 4 0 0 ----- [ anon ]
00000000421d0000 1024 12 12 rwx-- [ anon ]
00000000422d0000 4 0 0 ----- [ anon ]
00000000422d1000 1024 12 12 rwx-- [ anon ]
00000000423d1000 4 0 0 ----- [ anon ]
00000000423d2000 1024 12 12 rwx-- [ anon ]
00000000424d2000 4 0 0 ----- [ anon ]
00000000424d3000 1024 12 12 rwx-- [ anon ]
Thanks.
-
5. Re: Memory usage is odd
icantstand Aug 18, 2013 3:19 PM (in response to rm0han)Hello,
Why don't you use heapdump to analyse the issue?
Thanks
-
6. Re: Memory usage is odd
rm0han Aug 19, 2013 12:27 AM (in response to icantstand)I am trying that too but pmap seems to show that the JVM footprint is increasing due to increase of native memory. The heap limit is never crossed and we don't get any error like OOM. OOM is caused by native memory problems too but in this case the JVM functions but RHEL's ''used memory'' keeps on growing till we bounce JBoss. I see similary JVM problems on the net.
Thanks.