• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

High memory consumption, but empty heap

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,

I have a strange behaviour on my application. When I launch my application with -Xmx<MEM>, it seems to use all the <MEM> specified, even if I invoke the garbage collector using jconsole.
I've also tried using jprofiler and heap dump: using jprofiler, I don't see where all the memory is used, even if I have no filter; using the heap dump, I get the file the same size as the eccupied memory, but, when analyzing with jprofiler, I don't see all the allocated variables, but far less data.

I'm using Sun JDK 1.5.

Thanks in advances.
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,

I've got some more details about my problem: a part of (most of) the heap is NOT reachable so it should be eligible for garbage collection; instead, I get OutOfMemoryError .
I supposed it was caused by weak references, but it is not possible, because jvm should release them before throwing OutOfMemoryError.

Any idea?

Thanks in advances
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,

I've also noticed that I have a lot of small classes referenced by java.lang.ref.Finalizer. Those classes are generated by CGLIB (I'm using Hibernate).

Any idea?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perm Space should be out of the heap in JDK1.5. Do you have large libraries in WEB-INF/lib? Jprofiler should only view the memory in the heap without perm space

What kind of out of memory you have?

Do you use hot deployment? Because hot deployment with hibernate framework potentially resulted "out of memory: permSpace"
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,
and thank you for your response.

The permgen space should be enough (I've set it to an high value).
It seems to be an hibernate problem, which
1. creates some soft references without removing them, so the garbage collector sometimes decides to remove them
2. keeps a lot of java.lang.ResultSet references because of a bug

After solving the two problems, I had no more memory consumption.

Again, thanks a lot for your support.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic