• 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

how to increase heap size with eclipse?

 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i guess i used the correct term - heap - instead of memory
i have my application developed with eclipse 3, java 6, in a winXp professional with 1,99GB of memory
at the beginning i got a outOfMemory exception and thought it was something related with POI, excel and java; in this topic i was told i had to give java more memory
after some research i got it going, starting it up manually, with success:
C:\proj\bin>java -Xms256m -Xmx1000m -classpath .; gui.Mercados bd dominio excepcao gui imaAF util org com lib
(before that i had try setting those values in java console, but with no effect)
so i went back to eclipse and edited eclipse.ini:
-vmargs
-Xms256m
-Xmx1000m

if i go to eclipse configurations, i can read:
*** Date: Tue Jan 12 21:38:42 GMT 2010

*** Platform Details:

*** System properties:
awt.toolkit=sun.awt.windows.WToolkit
eclipse.buildId=M20060629-1905
eclipse.commands=-os
win32
-ws
win32
-arch
x86
-launcher
C:\eclipse\eclipse.exe
-name
Eclipse
-showsplash
600
-exitdata
4e8_c0
-vm
C:\WINDOWS\system32\javaw.exe
(...)
eclipse.vm=C:\WINDOWS\system32\javaw.exe
eclipse.vmargs=-Xms256m
-Xmx1000m

but, still, the same exception...
in the meanwhile i was told in that topic to play around with eclipse run configuratiom, which i did, but could not get a positive result

so, here i am asking how to solve this: does anyone have a concrete idea?

thanks in advance
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just change the -vmargs options in eclipse.ini; works for me. IIRC there are requirements for the -Xmx argument, like a multiple of 1024 or something, but I don't have an installation in front of me to check.
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:I just change the -vmargs options in eclipse.ini; works for me. IIRC there are requirements for the -Xmx argument, like a multiple of 1024 or something, but I don't have an installation in front of me to check.


i just changed it to 1024 but still that OOM... :rolleyes:

BTW what means IIRC?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I Remember Correctly--sorry!

What about MaxPermSize?
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:If I Remember Correctly--sorry!

What about MaxPermSize?


where would i set it?
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the properties window of the eclipse shortcut i set:
C:\eclipse\eclipse.exe -vmargs -Xms512m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m, but
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd set it in the eclipse.ini, but it might work from the command line; I've just never done it like that.
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
eclipse.ini:
-vmargs
-Xms256m
-Xmx1024m
-XX:PermSize=512m
-XX:MaxPermSize=512m

but still no results
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then there's a memory leak somewhere, or a library issue, or a capacity issue, or you just need to allocate more memory: at this point it may not be an IDE issue.
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you David once again
i'm about to quit
this is a finished standalone swing application, where i wanted to read a diferent excel file
what happens is that when i read this file (with about 8 megas and only two sheets) i get that OOM error; if instead i use another exel file, everything is ok
i built this app using eclipse and ant (for jaring)
At this moment i can run and jar using command line (manually increasing heap size), but to read the jar i also need to manually increase java heap size
i tried to increase jre memory size inside java console, but it doesnt work
also, i tried (and tried over and over again) increasing heap size in eclipse, but also no results (i found the official eclipse faq, tried their solutions too, but, no, OOM pops up)
as to ant, i used ANT_OPTS to increase memory soze too, but i cant run the app with it because of the -- guess what -- OOM exception
so, if anyone has any other idea, she's welcome; else, i quit
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me see if I understand this correctly. If you run your application standalone, then setting -Xmx1024m works and the app runs fine. Is that correct? If so, setting the max heap to 1024m in Eclipse will not work because Eclipse itself takes up a large amount of heap. I would try setting it to -Xmx1536m, or whatever the largest heap you can manage on your machine. That should give enough room for Eclipse and your app. Of course, if you plan to debug you might need more room...

The above assume that you are running your app in the same JVM as Ecipse, and not forking your app off into a separate JVM.

Also, you might want to set -XX:+HeapDumpOnOutOfMemoryError. Then when you get a OOME you will also get a heap dump file which you can load into VisualVM, Eclipse MAT, or some other tool and examine what is using up all the heap memory.
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Johnson wrote:Let me see if I understand this correctly. If you run your application standalone, then setting -Xmx1024m works and the app runs fine. Is that correct? If so, setting the max heap to 1024m in Eclipse will not work because Eclipse itself takes up a large amount of heap. I would try setting it to -Xmx1536m, or whatever the largest heap you can manage on your machine. That should give enough room for Eclipse and your app. Of course, if you plan to debug you might need more room...

The above assume that you are running your app in the same JVM as Ecipse, and not forking your app off into a separate JVM.

Also, you might want to set -XX:+HeapDumpOnOutOfMemoryError. Then when you get a OOME you will also get a heap dump file which you can load into VisualVM, Eclipse MAT, or some other tool and examine what is using up all the heap memory.


when playing with several memory sizes i came to the conclusion 256 was enough for running from java:
prompt> java -Xms256m -Xmx256m etc..
as i said before, setting memory size in java console is worthless, so i left it cleared, as it was at first
so, nothing set at java console (and 256 is enough for javaRE)
at eclipse init i set the max possible:
-vmargs
-Xms128m
-Xmx1024m
OOM
now i add:
-vmargs
-Xms512m
-Xmx1024m
-XX:PermSize=128m
-XX:MaxPermSize=512m
still OOM with several memory combinations
so, all this is meant to clarify your firsy point; as to the next one i guess i'm using the same vm
have to check and let you know as soon as i can
thank you!

note: i'm still convinced that what's hapening is because of the excel's file size: just two sheets and about 8 megas - because i can read from any other excel file without any problem...
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the meanwhile i got an important advance: eclipse runs without the OOM error!
i went to Run Settings > Separator (x) Arguments > VM Arguments
and there i wrote: -Xms256m -Xmx1024m
now i'm left with (another) serious problem: when i jar it, and then want to run the jar, i again need to manually increment memory size
does anyone have any idea how to permanently increase java memory size?
i tried setting it in java console but without any result...

thanks in advance
 
And then the flying monkeys attacked. My only defense was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic