Solved

How to handle java.lang.OutOfMemoryError: PermGen space Error.

Posted on 2007-11-29
11
1,105 Views
Last Modified: 2013-11-23
I am getting "java.lang.OutOfMemoryError: PermGen space" Error .in java.
How do iit goes away?
Thanks
0
Comment
Question by:Anj78
11 Comments
 
LVL 17

Expert Comment

by:contactkarthi
Comment Utility
set maxpermsise while running the program

-XX:MaxPermSize=256m
0
 

Author Comment

by:Anj78
Comment Utility
where exactly.
Thanks
0
 

Author Comment

by:Anj78
Comment Utility
I am waiting for respose.I didnt file the location where i have to set the above  MemSize.
Thanks.
0
 
LVL 17

Accepted Solution

by:
contactkarthi earned 250 total points
Comment Utility
java -XX:MaxPermSize=256m MyProgramName

MyProgramName is the class file you are running
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:Anj78
Comment Utility
java -XX:MaxPermSize=256m MyProgramName
 The above command tried .But still getting the same error
Thanks.
0
 
LVL 8

Expert Comment

by:malfunction84
Comment Utility
Try increasing the number to 512m.  If you continue to get the same error, you might have a memory leak.  Check for collections (Lists, Maps, etc) that grow continually, never having elements removed.
0
 

Author Comment

by:Anj78
Comment Utility
i am running the java application and not running through  eclipse.Can any body help me to find out the solution.
Thanks.
0
 

Author Comment

by:Anj78
Comment Utility
%JREDIR%\bin\java -Xms128M -Xmx512M %SYSTEMPROP% %ENVPROP% -Dcom.pjx.ejb.server.Embedded=true -Djava.security.policy=%POLICY% -Djava.ext.dirs=%EXTDIRS% -Dcom.pjx.bootstrap.ProcessName=%PROCESS% -Dsubstitution.RUNDIR=%RUNDIR% -Dsubstitution.JAVADIR=%JAVADIR% -Dcom.pjx.help.server.Release=7 com.pjx.bootstrap.DevLauncher

This is what is there bu default in run file.Now i am still getting error.
do i am setting the right place?
0
 
LVL 92

Assisted Solution

by:objects
objects earned 250 total points
Comment Utility
> This is what is there bu default in run file.Now i am still getting error.
> do i am setting the right place?

I don't see "-XX:MaxPermSize=256m" being specified in the command line you just posted.

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

772 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

11 Experts available now in Live!

Get 1:1 Help Now