• Post Reply Bookmark Topic Watch Topic
  • New Topic

Heap Size keeps growing

 
Collin Goredema
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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?
 
Fred Abbot
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • 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
 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • 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
 
lekha phijo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hav u found an answer to your problem of outof memory error.
I am facing a similar problem.
 
John Dunn
slicker
Ranch Hand
Posts: 1108
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!