• 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

Increase eclipse memory

 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a very large project I am trying to clean and rebuild in the latest version of eclipse 3.0. During the compile I get a java outofmemoryerror. How do I configure eclipse to used more memory for the java compiler like setting the -X parameters for the jvm.

Thanks,
Jeremy
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use the -vmargs option when starting eclipse. See http://help.eclipse.org/help21/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/running_eclipse.htm
 
author
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeremy Wilson:
I have a very large project I am trying to clean and rebuild in the latest version of eclipse 3.0. During the compile I get a java outofmemoryerror. How do I configure eclipse to used more memory for the java compiler like setting the -X parameters for the jvm.


Begin by specifying the starting amount of memory (-vmargs -Xms###M) in your Application Developer/Eclipse startup command line (e.g., the target field within a Windows shortcut). If this is not specified, Eclipse's starting amount of memory is quite small (only 64MB - see http//java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html and scroll down until you find the -Xms option description), and can really slow down your startup and initial usage time. What happens with a small starting memory like 64 MB is that the java virtual machine (and thus Eclipse)...

1) tries to use currently allocated memory (initially 64MB)

2) garbage collects several times

3) finally determines that it really needs more memory

4) allocates more memory incrementally

5) repeats this process until it reaches a steady state

If you know you are going to use at least 128 MB or more, then try specifying -Xms128M or larger as the starting memory. It should improve your startup time and initial usage prior to swapping.

If you are certain that you are going to swap, then at least try to reduce the amount of time spent garbage collecting. For example, if Application Developer/Eclipse has to live within 256 MB, then it may be spending much of its time garbage collecting which appears like swapping (application freezes or slows to a crawl for a while). You might try specifying -Xmx384M as your maximum memory usage to reduce the amount of garbage collecting. Even if you have many large applications running simultaneously, you likely use one program for a while, then switch to another, then after a while switch back. The key here is that using a program for a while and ignoring the others, plus a larger maximum memory for java (like 384 MB) lets Application Developer/Eclipse take advantage of more physical memory and garbage collect less while the other programs are swapped out. Obviously there's a trade off of maximum memory for a program versus the physical memory available... you'll have to find that "sweet spot" somewhere between 256MB and 1GB for your machine.
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic