0

On Linux server vm arguments (Xmx=3GB, Xms=3GB) have been specified for application. By seeing the heap dump it can be seen that more than 2.9 GB memory has been utilized. 32 MB memory is there for unreachable objects.

But the application did not throw OOM, instead it has stopped responding. So it became necessary to restart the application manually.

I can see many threads(96) waiting on monitor of some specific object in stack trace. Does that help? Also most of the 2.9 GB space is occupied by cache objects, which is normal I think. MAT is showing these cache objects only as leak suspects.

Trying to find out what made it to not respond but don't see any thing special by looking heap dump and stack traces.

Kara
  • 6,115
  • 16
  • 50
  • 57
Raju Singh
  • 137
  • 1
  • 9
  • Just a thought: If you specify the *initial* heap size to be the same as the *maximum*, one would expect around (in your case) 2.9Gb utilization. Have you tried eg. `-Xms=512M`? – Anders R. Bystrup Nov 22 '12 at 11:07

2 Answers2

1

Your application has a memory leak. Try to find it, there are good tools like VisualVM.

Kai
  • 38,985
  • 14
  • 88
  • 103
  • In that case it should have thrown OOM. I have tried with VisualVm and found that most(2.9 of 3 GB) memory was in use, but still it doesn't lead to any conclusion. – Raju Singh Nov 22 '12 at 10:49
  • You have to learn how to use VisualVM... Take memory snapshots at different times and compare them regarding new objects. – Kai Nov 22 '12 at 10:54
  • Had it been test env i'd have done that. but i'm doing a post event analysis. – Raju Singh Nov 26 '12 at 04:10
  • @RajuSingh VisualVM is what you are looking for. If you don't want to spent any effort you won't solve your problem. – Kai Nov 26 '12 at 08:51
  • I have already told that its not reproducible now. I have used VisualVM for quite long time. Its the only heap which i have. When i run the app its not a problem now. I am just asking what to look for as suspects other than suggested by VisualVM or MAT? – Raju Singh Nov 28 '12 at 12:56
0

Usually, before having the OOM applications are VERY slow.

In your case you should profile your application with VisualVM by example.

ioan
  • 489
  • 2
  • 4
  • I tried that but it was a huge heap dump file. Though VisualVm could open it after tweaking Xmx options on .ini file, but found nothing.Moreover the application is now running fine but we need to investigate the bhavior at the time of erroneous situation. – Raju Singh Nov 22 '12 at 10:46