java.lang.OutofMemoryError in Sun Studio 12

Hello everyone,

I have installed Sun Studio 12 in my Sun Solaris 10 (x86) OS. At first, there was nothing wrong with it but recently, I couldn't open the Sun Studio IDE. When I try to open it, I keep on getting the following error messages:
________________________________________________________

java.lang.OutOfMemoryError: Java heap space
at org.openide.util.io.NbObjectInputStream.readSafely(NbObjectInputStream.java:151)
at org.netbeans.core.LoaderPoolNode.load(LoaderPoolNode.java:618)
at org.netbeans.core.NonGui.run(NonGui.java:82)
at org.netbeans.core.startup.Main.start(Main.java:399)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:96)
at java.lang.Thread.run(Thread.java:595)
________________________________________________________

I found some suggestions in a thread, like adjusting the heap size using the -J-Xms and -J-Xmx options when running sunstudio, specifying the desired heap size in the netbeans.conf file, and adding more swap space through mkfile. However, these didn't solve the problem.

I tried running the NetBeans IDE and it's working perfectly.

Anybody here who might know why? I would really appreciate your help.
Thank you very much!

Cheers,
wintersakura

What are your Xmx and Xmx setting at now? I have never seen the '-j' in the -j-Xmx you posted used. How does that compare with when you lauch a normal netbeans?

The second thing is that it not unusual to need to set the minimum heap size to the same value as maximum, becasue the JVM is not always able to re-allocate correctly at runtime.

As things stand adding swap will not make any difference, it is only the heap size that is a problem, if you were running out of swap you would get "java.lang.OutOfMemoryError: Insufficient Space to grow Heap"

Hello reborg,

I switched back my Xms and Xmx settings to the default ones (-J-Xms32m -J-Xmx128m). Before, I tried this suggestion at the Sun Studio Tools Forum:
________________________________________________________________________

I would recommend to try 512m first:
/opt/SUNWspro/bin/sunstudio -J-Xms256m -J-Xmx512m

Setting maximum JVM heap size to 1Gb might sometimes cause performance issues.

I'd also like to mention that these settings can easily be changed in
/opt/netbeans5.5/etc/netbeans.conf
so that you don't have to specify them in command line each time.
________________________________________________________________________

The swap -l command often gives this result:
swapfile dev swaplo blocks free
/dev/dsk/c1d0s1 102,1 8 1060280 1060280

The df -k command gives me this:
Filesystem kbytes used avail capacity Mounted on
swap 988464 852 987612 1% /etc/svc/volatile
___________________________________________________________________

Thank you for your help. ^-^