?
Solved

Out of Memory exception

Posted on 2006-06-02
10
Medium Priority
?
255 Views
Last Modified: 2008-02-01
Our application is currently using java version 1.2.2. Recently, we have experienced Out Of Memory exception and I believe this occured as they were multiple threads running at this time using buffer space. Is this a known issue. Can this be resolved after migrating to Java 1.4? Please suggest.Thanks for your help.
0
Comment
Question by:g46905
9 Comments
 
LVL 15

Assisted Solution

by:Javatm
Javatm earned 400 total points
ID: 16819614
1.4 can be a solution or you can try :

increasing the amount of memory available to the VM using -Xmx command line option
eg. to give it 512mb

java -Xmx512m .... if that is availabel in 1.2 if not try 1.4 if you experience the same problem
then increase the amount of memory of your application using the above solution.
0
 
LVL 14

Expert Comment

by:hoomanv
ID: 16819752
for 1.2

java -Xms32m -Xmx128m

Xms: the initial amount of memory allocated for your program
Xmx: the maximum amount of memory that can be allocated for your program
0
 
LVL 92

Assisted Solution

by:objects
objects earned 400 total points
ID: 16820924
OOM error occurs when the VM cannot fulfil a request for more memory.
Ifd your application shouldn't require an excessive amount of memory then it could be caused by a memory leak.
Make sure you remove any references to variables when they are no longer needed.
You could use a profiler to determine where your memory was being used.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 24

Expert Comment

by:sciuriware
ID: 16822287
g46905, if you have run this application for some time and suddenly one day this happens,
may be only the use of it has grown.
If you never applied the -Xmx  arguments, you are still running with a maximum of 64Mb.
So may be nothing is wrong, just set it to -Xmx80m.
If that runs ok, you know it: things grow a bit.
Be prepared that one day 80Mb is not enough, so keep an eye on it.

You can speed up things by specifying:
                             -Xms64m -Xmx80m
which gives you 64Mb at once, because you know you need it, growing permitted to 80.

;JOOP!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16823768
>> Can this be resolved after migrating to Java 1.4?

If you have to migrate then why not Java 5 ;) ?
0
 

Author Comment

by:g46905
ID: 16894390
I am currently using WSAD 5.1 and I believe this contains the required compiler to migrate to 1.5.Can a new compiler be added to WSAD?

Thanks
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16894524
I'm not sure because I don't have WSAD with me right now and when I worked with it, I worked with only Java 1.4. I'm not sure if WSAD 5 will support Java 5.
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 17120465
Agreed.

;JOOP!
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 1200 total points
ID: 17122673
For development, though, WSAD 5.1 does not support Java 5 even if you try to add it as a JRE. The best bet is to use Eclipse.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 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