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
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.
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
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com