Solved

What Does "OutOfMemoryError" Mean?

Posted on 1997-08-05
2
186 Views
Last Modified: 2010-04-16
Hi, I keep getting "OutOfMemoryError" when I switch between three pages I have that each hold three different applets.  What causes this error?   Thank you
0
Comment
Question by:dbMan
2 Comments
 
LVL 1

Accepted Solution

by:
katya062697 earned 170 total points
ID: 1224434
OutOfMemoryError means ... that the system is out of memory resources. You have 3 applets per page = 9 applets, all of which might be memory hungry. Now, applets do not give up their resources even when you move to another page, so you will have 9 applets running at the same time ==> out of memory.

Solution: implement init(), start(), stop() and destroy() methods in each of those applets.
These are called by the browser when:
init() - when applet starts first time
start() - when applet is activated (you are back to that page)
stop() - you move off the page
destroy() - browser exits
In the stop method give up all those resources (depending on the resources you are using, this might mean closing files, stopping threads, calling the garbage collector explicitely, etc.), and get them back in the start method. This way you will not have more than 3 applets running at a time. To be even more conservative, you might implement gotFocus() and lostFocus() methods for each applet to allocate and/or give up some resources, as needed.

Hope this helps.
0
 

Author Comment

by:dbMan
ID: 1224435
thanks!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTTPSessionBindingListernter not configured in deployment descriptor 2 65
factorial example 4 49
java imports not found 4 29
Selenium docs api java index 3 48
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question