Solved

What Does "OutOfMemoryError" Mean?

Posted on 1997-08-05
2
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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 “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

630 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