Tinkering with idea.vm.options

I'm currently working with a large project (big piece of ***) , for which the current default vm options shipped with IDEA is not adequate.

I thus went to settings>idea vm options and changed the XMX param to 2048m (i've got 4Go of memory on this machine).

I then closed IDEA and tried to restart it, but it didn't want to ! :)
Tuning down the XMX to 1024m resolves the problem, but it can't find anything describing a max allowed value for XMX in sun document for JDK 1.5.

Has anyone any more info about it ?

5 comments
Comment actions Permalink

I've seen the same thing on Windows machines. 1024M is the max that IDEA will usually start with.

--Dave Griffith

0
Comment actions Permalink

OS limitation. If you are on Windows the java process memory limit is about 1.5 GB, but there is some difference between various versions of the virtual machine. Under other operating systems Java is able to allocate almost 2 GB (or more with special OS startup switches, but I haven't tried this). Obviously, on a 64 bit OS using a 64 bit jvm, it is possible to go much much larger than this.
The reason for this is that Windows splits the 4 GB 32 bit address space in two chunks, 2 GB for kernel address space and 2 GB for user mode address space. Java wants a single continuous memory block. In this block Java's dlls, stacks, perm generation and other stuff are also allocated, which apparently need about 500 KB and the rest is for the heap. Unfortunately even when starting Windows with the /3GB switch it is still not possible to allocate a single block of memory larger than 2 GB.

Bas

see also:
http://forum.java.sun.com/thread.jspa?threadID=553939&messageID=2712071
http://blogs.msdn.com/oldnewthing/archive/2004/08/16/215089.

0
Comment actions Permalink

Also try these :

-Dsun.awt.keepWorkingSetOnMinimize=true
-XX:+DisableExplicitGC
-XX:+UseConcMarkSweepGC
-XX:NewSize=800m
-XX:SurvivorRatio=16

They made the life a bit easier for me (still IDEA dies for long periods, not so often though)

0
Comment actions Permalink

Thanks a lot to everyone.

I'm indeed using Windows (2000 SP4 on Intel 32 bits), I forgot to specify it.

0
Comment actions Permalink

What really worked wonders for me (specially if you're on a dual core machine) is:

-XX:+UseConcMarkSweepGC
-XX:NewRatio=4

In other words: enabling the concurrent, parallel garbage collection and making the young generation a tad larger. The former prevent large pauses by collecting garbage constantly, on the background. If you have a dual core machine, you shouldn't notice a performance hit. The latter enlarges the young generation, enough to make room to the large amount of temporary objects created during inspection passes.

0

Please sign in to leave a comment.