Mapping native memory usage to JVM

302 views
Skip to first unread message

Mohan Radhakrishnan

unread,
Aug 18, 2013, 2:46:13 AM8/18/13
to mechanica...@googlegroups.com
Hi,

This is not strictly related to concurrency but there seems to be some confusion about native memory leaks. There are many posts about such leakages shown my pmap. In our case it could be code like this that does not close streams.

InputStream ins = fileName.getInputStream();

BufferedReader bug = new BufferedReader( new InputStreamReader(ins));


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 ]


Since the forum focuses on interaction of the VM with native OS's and hardware I thought I can try here. I have found the most likely cause from pmap(thousands of 'anon' allocations). How do I link this back to open streams or the thread stack ? I can't run valgrind on the production server. External Libraries using NIO may be used by this huge java application but these open streams are used heavily. The result is that RHEL's used memory is gobbled up and the JVM's(1.6.0_33) have to be bounced. 


Is there a recommendation ? I have asked the Oracle JVM forum too.


Thanks.

Peter Lawrey

unread,
Aug 18, 2013, 3:04:23 AM8/18/13
to mechanica...@googlegroups.com
Can you run a test to see if these increase if you perform a particular operation. e.g. open more files?


--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Mohan Radhakrishnan

unread,
Aug 19, 2013, 12:19:03 AM8/19/13
to mechanica...@googlegroups.com
Yes. Is there a usual way of linking this back to what the JVM is doing ? 1024k seems to be the default 64-bit thread stack ?

Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages