Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Performance and the fly likes Out of memory after 14 hr operation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Out of memory after 14 hr operation" Watch "Out of memory after 14 hr operation" New topic
Author

Out of memory after 14 hr operation

VivekJapani Nath
Greenhorn

Joined: Dec 15, 2003
Posts: 1
I am facing a problem with "out of memory excpetion".I am invoking an applet from my HTML page ( on an IE browser 6 with SP1).This applet is invoked as client from a location in USA while the servers reside in hungary.This applet leads to a massive operation of finding results and making searches on the server.but the end result is that i should make a "jar" file out of these results and put them on the local client machine
The operation almost runs for 14 hours and then fails with memory exceptions.I have the JRE 131_09 running on the client side with the follwoing JVM settings:=
-Djavaplugin.maxHeapSize=384m -Xms128m -Xmx384m -Xverbosegc -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect -djavaplugin.logging=true
In this time i can see the IEXPLORE in my task manager slowly sucking up the memory and at 572 MB memory usage point i see the above error.My client machine is windows 2000 prof with SP3 and 1GM of RAM
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

Hi,
Wlcome to JavaRanch!
Well, the first step might be to figure out how much RAM you think the applet might consume. It might be that the applet simply needs more memory than you're giving it.
If it should need nowhere near the amounts you've set, then you should start looking for a memory leak. In Java, a memory leak is an accidentally retained reference to an object that should otherwise be garbage collected. Commercial profiling tools like JProbe can help you find these, but you can also find them just by looking at the code. Just make sure that object you are no longer using aren't held in a collection, referenced by an event listener or unterminated thread, etc.


[Jess in Action][AskingGoodQuestions]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12785
    
    5
What sort of things is the Applet doing during this time? The answer will help us figure out possible memory problems.
For example, if it is doing graphic presentation, there are various known pitfalls there. JDBC operations lead to other problems, etc.
Bill
Raja Raja
Greenhorn

Joined: May 17, 2003
Posts: 8
I feel u r fetching a huge resultset and writing into a file.
probably u r creating an object for every record in resultset.
which must be flooding the heap. This is my guess with the limited idea i get from ur query. if it is so resue the objects rather than creating new one and fetch few results at a time and then merge the files.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Out of memory after 14 hr operation