Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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

Heap Size keeps growing

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am running a set of programs that are being called by servlets fom Apache Tomcat. I am seeing a problem where the JVM keeps gobbling up memory; I have even gone to the extend of allocating 640MB to the heap and yet I keep getting OutofMemoryError exceptions. Has anyone seen this or does anyone have a possible explanation?
 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you are proberly not releasing all refrences to an object therfore it is not being garbag collected
try increasing the heap size
 
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rather than just increase your heap size again, why don't you try using a profiler? These are tools which can let you watch your program behave, kind of like an advanced debugger. They can help you find memory leaks. Two that I recall off the top of my head are JProbe and OptimizeIt. (They definately pay for themselves quickly on most projects.)
--Mark
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hav u found an answer to your problem of outof memory error.
I am facing a similar problem.
 
slicker
Posts: 1108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using pooled objects? If so, careful how you re-initialize them. I had a problem with a pools of objects that contained a reference to a file pointer and about 30 other objects. The 30 other objects were initialized before retrieving the pooled object and the file pointer was recreated, since you can't re-use file pointers. Well the gc never released any of the file pointers!!! b/c the object that owned them was in a pool of shared objects - Even though the original reference was set to null.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic