Solved

What Does "OutOfMemoryError" Mean?

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomcat startup error 5 136
ejb entity bean example issue 2 29
running on tomcat not jboss eap 7.0 3 33
Java pass by reference 3 25
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

730 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