4

I have taken the memory dump, analysed it with memory analyzer. It showing 73% of memory taken by java.lang.ref.finalizer object. I went to see what is inside this very big object. I found it looks like recursive trail of objects. which looks like below

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

Inside the FileResource i found path to extract of war file, but could not find what is inside 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.

hridayesh
  • 1,123
  • 1
  • 14
  • 36

1 Answers1

2

That is not a leak per se. Please read this: http://www.oracle.com/technetwork/articles/javase/finalization-137655.html about finalisation mechanism in JVM.

Finalizers can become a problem, if too many finalazble objects are created, in your case FileInputStream. You can try to decrease your heap size somewhat in order for Garbage Collector to run more frequently and dispose of them faster.

Or, better if possible, decrease your usage of FileInputStreams.

Nikem
  • 5,716
  • 3
  • 32
  • 59
  • We are running high load web application on Jetty Server 8, so We kept memory of 2GB for that process. using jmap found that old generation memory is filling fast and we always restart server at 90% old gen. Will it be cleaned when memory is full. Just worried for server crash. – hridayesh Aug 30 '12 at 07:00
  • Truth be told, it is strange to restart server at 90% old gen. Don't you trust GC? Or you have an insufficient memory for your data amount? Or do you suspect a memory leak? Then try our http://plumbr.eu tool. – Nikem Aug 30 '12 at 07:45
  • I did not know about Finalizer in Java and suspected memory leak, Thats why restarted. Thank you for clarification. But does GC not runs until all memory is full. Will GC work only run when 100% memory is filled with old gen Finalizer objects. – hridayesh Aug 30 '12 at 10:21