• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.OutOfMemoryError: Java heap space

 
Ranch Hand
Posts: 86
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Eclipse , go to

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

 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"
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?
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you need to edit the following file:

%IDEA_HOME%\bin\idea.vmoptions

Certainly, this is true for Intellij IDEA.
 
James Boswell
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.......:-)

 
reply
    Bookmark Topic Watch Topic
  • New Topic