This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes OutOfMemory-Eception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "OutOfMemory-Eception " Watch "OutOfMemory-Eception " New topic
Author

OutOfMemory-Eception

Blikkies Marais
Ranch Hand

Joined: Jun 12, 2003
Posts: 50
The memory usage of the VM is growing and growing with each request. This is going on until a OutOfMemory-Eception occures. Is there any reason why it is not being garbage collected?
Im using j2sdk1.4.1_02. I have tried Resin 2.1.6 and Tomcat 5.0.12.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8839
    
    7

You are allocating some resource (i.e. database connection) and not freeing it. That's all I can tell you without you posting some code for us to look at.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Herb Schildt
Author
Ranch Hand

Joined: Oct 01, 2003
Posts: 239
I agree with Joe, you probably aren't releasing resources. If you don't think this is the case, can you give us more info (or post code as Joe suggests)? Finally, as an experiment, you might try called System.gc() to request garbage collection just to see if it changes anything. Its effects might offer a clue.


For my latest books on Java, including my Java Programming Cookbook, see HerbSchildt.com
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
Finally, as an experiment, you might try called System.gc() to request garbage collection just to see if it changes anything. Its effects might offer a clue.
Another option is to start JVM with a -verbosegc option and try to correlate your program activities with the garbage collector log. Better yet, run your program through a profiler (such as OptimizeIt) to identify the memory leak.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OutOfMemory-Eception
 
Similar Threads
OutOfMemory error
outOfMemory
OutOfMemory
Need Help Understanding OutofMemory
outOfMemory