Memory leak in jdk1.7.0
We've tried jdk1.7.0. After two days of running we observed the memory leak of the following objects:
- java.lang.management.MemoryUsage,
- [C (array of char),
- java.util.HashMap$Entry,
- [Ljava.util.HashMap$Entry (array of HashMap$Entry),
This doesn't happen on jdk1.6.x.
First output of the "jmap -histo:live" command:
num #instances #bytes class name
----------------------------------------------
1: 426710 20482080 java.lang.management.MemoryUsage
2: 251358 18621624 [C
3: 448926 14365632 java.util.HashMap$Entry
4: 1877 11657320 [Ljava.util.concurrent.ConcurrentHashMap$HashEntry;
5: 63326 9309352 <constMethodKlass>
6: 63326 8630336 <methodKlass>
7: 234908 7517056 java.lang.String
8: 6365 6970232 <constantPoolKlass>
9: 94584 5828744 [Ljava.util.HashMap$Entry;
Second output of the "jmap -histo:live" command after 2 days of running:
num #instances #bytes class name
----------------------------------------------
1: 426900 20491200 java.lang.management.MemoryUsage
2: 251459 18636704 [C
3: 449116 14371712 java.util.HashMap$Entry
4: 1877 11657320 [Ljava.util.concurrent.ConcurrentHashMap$HashEntry;
5: 63326 9309352 <constMethodKlass>
6: 63326 8630336 <methodKlass>
7: 235009 7520288 java.lang.String
8: 6365 6970232 <constantPoolKlass>
9: 94622 5830568 [Ljava.util.HashMap$Entry;
The bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7128632 was recently fixed in the 7u4 b13 and was marked as a duplicate of the bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7143760 .
BTW, this forum seems to be dead. Use mailing lists instead. http://mail.openjdk.java.net/pipermail/jdk7u-dev/
Memory leak during startup of weblogic 7.0???????????
-----------------------
STC Technologies|Reputation Management





This code reproduces the bug on any Java 7 (7, 7u2 and 7u4 build 11 which is not GA yet).
The corresponding bug on bugs.sun.com: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7128632
Code sample:
----------------------------------------------------
jmap output shows that GcInfo instance count constantly increases: