Solved

What Does "OutOfMemoryError" Mean?

Posted on 1997-08-05
2
183 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

706 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now