• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

OutOfMemoryError : Suggestions for debugging

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to debug an OutOfMemoryError we are getting on Web application which is based on Spring Web flow + Hibernate + c3p0 connection pool.

I am using Jmeter to simulate the load of 5 concurrent users on this system and withing 5 minutes the applications runs out of memory with below message.

java.lang.OutOfMemoryError: Java heap space
Exception in thread "http-8080-3" java.lang.OutOfMemoryError: Java heap space


The applications is not doing much processing so I assume so much memory is not required for it.

I am using JProfiler to do application profiling, but I am kind of new to it so may be any suggestions on a good profiling tool are also welcome.

Looking at the object allocations I see there are too many objects of java.util.concurrent.ConcurrentHashMap and its inner classes. See the attached image with JProfiler report.


Let me know what could be the possible reason for this. I am open to any ideas you have.


On Production we are running this application with 1.5GB JAva Heap space and it runs out of memory within 2-3 days.
profiling.JPG
[Thumbnail for profiling.JPG]
JProfiler output snapshot for all objects
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post what is the heap size you used in your server?

Definitely concurrenthashmap came up at top. But looking at the size it occupies, it doesn't seem to be a major issue.

~Rajesh.B
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is an article on memory leaks, their causes and how to resolve them.
 
Priyanka Dandekar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your replies, I figured out the issue. There was a place where a call to findAll method was made on a hibernate entity. This was bringing whole database in memory and we were running out.

I have removed this piece and it works now.

Thanks again for your responses.
 
Priyanka Dandekar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
for benefit of others, here are the consolidated list of commands which can help you debug similar issue

Debugging java OutOfMemory issue
 
reply
    Bookmark Topic Watch Topic
  • New Topic