File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes java.lang.OutOfMemoryError: Java heap space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "java.lang.OutOfMemoryError: Java heap space" Watch "java.lang.OutOfMemoryError: Java heap space" New topic
Author

java.lang.OutOfMemoryError: Java heap space

Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
java.lang.OutOfMemoryError: Java heap space...........................I googled this Error and I found that there are two JVM options used to tune JVM heap size: -Xmx for maximum heap size, and -Xms for initial heap size.

But I am not getting where in Intelli j(like Eclipse) I can edit JVM settings.

Can anybody help me out?


Thanks in Advance.
Haresh Sawant
Greenhorn

Joined: Mar 08, 2012
Posts: 4
In Eclipse , go to

Debug -> Debug Configuration -> Arguments -> VM Arguments

Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
"
Debug -> Debug Configuration -> Arguments -> VM Arguments

"

Thanks Haresh for your help.
But I am using Intellij and there I am finding Debug -> Debug Configuration and not Arguments where I can edit VM Arguements.
Is there any other alternative for the question?
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

I think you need to edit the following file:

%IDEA_HOME%\bin\idea.vmoptions

Certainly, this is true for Intellij IDEA.
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

Apologies, I misunderstood what you were asking. What I have stated above is the options for the memory when running Intellij itself.

For run/debug configurations, see this link: Creating and Editing Run/Debug Configurations

It looks like the Configuration tab is where you enter VM arguments.
Haresh Sawant
Greenhorn

Joined: Mar 08, 2012
Posts: 4
try this

Run- Edit Configurations -
Expand Grails - Grails:[projectname] - Grails tab
In the VM Parameters textbox, set the following:
-XX:MaxPermSize=<Required memory size>
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

Haresh

-XX:MaxPermSize is for Perm Gen, the memory allocated for loaded classes. This is not the same as the size allocated to normal memory (the heap).
Haresh Sawant
Greenhorn

Joined: Mar 08, 2012
Posts: 4
Yeah, You are right..
I mean in VM Parameters textbox, we can add required VM parameters
In this case it should be -Xmx
Please Correct me if I'm wrong...
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Thanks James and Haresh for your answers.

But when I am doing
Run- Edit Configurations - Expand Grails - Grails:[projectname] - Grails tab
It is creating new Application in grails(unnamed) and I have to define Main class as well as Vm Parameters for it.
So, what should I define in main class?
And also, how I have to write -Xmx syntax in Vm Paramerters text box?

Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Can I define Vm Parameter in existing Grail(Main class).

If Yes.......what should be the syntax to write Vm Parameters?
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Thanks for your answers.........I got the answer for my question.

Solution is---->There is a idea.exe.vmoptions file inside bin folder of IntelliJ IDEA.In which I edited -Xmx option to -Xmx1024m.......:-)

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.OutOfMemoryError: Java heap space
 
Similar Threads
Increase JVM heap size of eclipse
Problem with inserting new data into database using hibernate
startNodeManager.sh and startWeblogic.sh doesn't start to execute
Out of memory error
increasing java heap size