I have been looking at JVM heap sizes on os x both in eclipse and intellij and running applications directly through the command line and I'm seeing a weird behavior I am hoping someone can explain.
If I set the jvm heap size to something large (e.g. over 1gb) for eclipse and then run a hello world application that executes
System.out.println(Runtime.getRuntime().maxMemory());
I see that it has 129957888 (128mb) as max memory.
If I run the same experiment in intellij, I get the same result but the heap size indicator in the bottom corner says I'm only using 100mb out of 2gb that I can.
If I just run java test -Xmx1024mb, then it tells me that I have the right amount max memory. (8 times as much)
I have tried this on 10.6 and 10.7 and I'm seeing the same thing, so I'm wondering what is going on with the IDE's not consuming as much heap size as I want them to. I am getting heap out of space errors when I have gigs of ram on my machines sitting there unused and I am finding this to be ridiculous.
Thanks for any help anyone can provide.