Memory leak on Jetty 8 server

I took a memory dump, analyzed it using a memory analyzer. It shows 73% of the memory taken by the java.lang.ref.finalizer object. I went to see what is inside this very large object. I found this to be like a recursive trail of objects. which looks below

Finalizer |__ Finalizer (recursive) |__ java.io.FileInputStream or org.eclipse.jetty.util.resource.FileResource 

Inside FileResource, I found a way to extract the war file, but could not find what is inside the FileInputStream object.

Also screenshots can be found here. https://lh4.googleusercontent.com/-uZTZ031DlqI/UD33kMskuZI/AAAAAAAABYo/eOrqw65k_Mw/s1179/summary.png

https://lh6.googleusercontent.com/-yWBPUV_71js/UD33kAYYDEI/AAAAAAAABYk/J9fF_WwOeO4/s1074/details.png

Please let me know.

+4
source share
1 answer

This is not a leak in itself. Read the following: http://www.oracle.com/technetwork/articles/javase/finalization-137655.html about the finalization mechanism in the JVM.

Finalizers can become a problem if too many finalazble objects are created, in your case FileInputStream. You can try to slightly reduce the size of the heap so that the garbage collector can work more often and faster to dispose of it.

Or, if possible, better reduce the use of FileInputStreams.

+2
source

All Articles