jeffchannell.com

"GC Warning: Out of Memory! Returning NIL!"

Posted in Flex 3
2009-04-12 02:22:37 +0000 UTC

I encountered this error after reinstalling my OS (Ubuntu Linux, for the record) while trying to compile something with the Flex 3 SDK. A quick Google search didn't show anything, so I started digging.

The problem ended up being bad symlinks in /etc/alternatives.

jeff@mini:/etc/alternatives$ ls -l java*
lrwxrwxrwx 1 root root 34 2009-04-11 21:51 java -> /usr/lib/jvm/java-gcj/jre/bin/java
lrwxrwxrwx 1 root root 33 2009-04-08 20:23 javac -> /usr/lib/jvm/java-6-sun/bin/javac
lrwxrwxrwx 1 root root 43 2009-04-08 20:23 javac.1.gz -> /usr/lib/jvm/java-6-sun/man/man1/javac.1.gz
lrwxrwxrwx 1 root root 14 2009-04-11 21:51 javadoc -> /usr/bin/gjdoc
lrwxrwxrwx 1 root root 30 2009-04-11 21:51 javadoc.1.gz -> /usr/share/man/man1/gjdoc.1.gz
lrwxrwxrwx 1 root root 33 2009-04-08 20:23 javah -> /usr/lib/jvm/java-6-sun/bin/javah
lrwxrwxrwx 1 root root 43 2009-04-08 20:23 javah.1.gz -> /usr/lib/jvm/java-6-sun/man/man1/javah.1.gz
lrwxrwxrwx 1 root root 33 2009-04-08 20:23 javap -> /usr/lib/jvm/java-6-sun/bin/javap
lrwxrwxrwx 1 root root 43 2009-04-08 20:23 javap.1.gz -> /usr/lib/jvm/java-6-sun/man/man1/javap.1.gz
lrwxrwxrwx 1 root root 40 2009-04-08 20:23 java-rmi.cgi -> /usr/lib/jvm/java-6-sun/bin/java-rmi.cgi
lrwxrwxrwx 1 root root 39 2009-04-08 20:23 java_vm -> /usr/lib/jvm/java-6-sun/jre/bin/java_vm
lrwxrwxrwx 1 root root 38 2009-04-08 20:23 javaws -> /usr/lib/jvm/java-6-sun/jre/bin/javaws
lrwxrwxrwx 1 root root 48 2009-04-08 20:23 javaws.1.gz -> /usr/lib/jvm/java-6-sun/jre/man/man1/javaws.1.gz

Somehow 'java' was linked to java-gcj instead of java-6-sun. I went ahead and manually fixed it:

jeff@mini:/etc/alternatives$ sudo rm java
[sudo] password for jeff: 
jeff@mini:/etc/alternatives$ sudo ln -s /usr/lib/jvm/java-6-sun/bin/java /etc/alternatives/java

...and now Flex 3 compiles once again!