Profile Image
nihar

memory not freed after GC

Memory is not getting freed after the GC runs and completes. And then allocation failure. Please see this report - 

http://192.168.0.104:8080/my-gc-report.jsp?p=QzpcV09SS1x5Yy1sYXRlc3Rcc2hhcmVkXDIwMjItMTAtMjlccGEtY2FuY2VsLXNlcnZpY2UtMjYtNHI1Y3MuMjAyMi0xMC0xOF8wOC00Ny0zMS0wLTE1LTU=&channel=WEB

 

Please help. Thanks.

  • gc-log

  • memory not freed

  • allocation failure

  • memory leak

Please Sign In or to post your comment or answer

Profile Image

Ram Lakshmanan

Hello Nihar!

 I think you are sharing the GCeasy report generated from your local IP: 192.168.0.104 - which is not accessible by us. Can you paste the heap usage graph - so that we can see what's going on?

 

 However based on your description, I suspect there is a memory leak in the application. When there is a memory leak in the application, even when GC completes running, memory will not get freed up. 

 

 Here with I am sharing two pointers, which might help you:

 

a. Different GC patterns. Check out the memory leak pattern and see whether that's what you you are experiencing.

 

b. You can debug memory leak by following this video talk.

 

 

 

Profile Image

nihar

 

I am sorry ram,Please see this. Thanks.

 

Profile Image

nihar

Ram, Also i do have a quick question. In the above figure Full GC ran only thrice. And then the memory spiked and stayed there for a long time
Surprisingly the Full GC did not run after that and the memory spiked did not even come down. Strange it is. 

Profile Image

Ram Lakshmanan

Hello Nihar!

 

 I suspect after Oct' 18 2:30pm UTC there wasn't much traffic in the application. Since traffic volume was quite low, full GC didn't run! I don't see any problem in this GC behaviour! 

Profile Image

nihar

Thanks Ram, But why the memory stays there for a long time (12 hrs) at ~58 when if the traffic is less ? Because of more objects getting created unecessarily/ memory leak ? Thanks

Profile Image

Ram Lakshmanan

Hello Nihar!

 

 I hear your question. Some of the GC behaviours are not explainable. However I am optimistic if you can trigger a full GC on the application through external source like System.gc(), jcmd, JMX, .... in that 12 hour window heap usage would drop. Just because Full GC isn't triggered memory is at that same level. 

 

 I am equally optimistic that your application isn't suffering from memory leak. If your application is suffering from memory - your GC graph pattern would like the one below. You can see Full GCs running repeatedly and memory usage not going down. For more details about this GC pattern, you can refer to this post.

 

 

Profile Image

nihar

Thank you so much Ram!

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • gc-log

  • memory not freed

  • allocation failure

  • memory leak