Memory leak of java.lang.ref.WeakReference objects inside JDK classes
- by mandye
The following simple code reproduces the growth of java.lang.ref.WeakReference objects in the heap:
public static void main(String[] args) throws Exception {
while (true) {
java.util.logging.Logger.getAnonymousLogger();
Thread.sleep(1);
}
}
Here is the output of jmap command within a few seconds interval:
user@t1007:~ jmap -d64 -histo:live…