I have a Tomcat6 server running on Debian squeeze there are 4 webapps running on it, and an in-JVM ActiveMQ server.

It has been running for about a year with the same memorysettings, with openjdk-6. Everything has worked dandy, no issues at all.

Now, for various reasons, i need to try out Sun's JDK.

So, I installed sun's jvm with standard apt-get

apt-get install sun-java6-bin , and switched using

update-java-alternatives -s java-6-sun

However, when i start tomcat, i get outofmemory, the server won't even start! If i switch back to openJDK, all works fine again.

I haven't had any memory issues on this server before, so it feels strange that the server suddenly won't start with sun's JDK.

Anybody have any clue as to why this might happen? Have i missed something?

I naturally have set heap sizes etc. in tomcat. Currently running with:

-Xms256m -Xmx1024m

Which as mentioned works in openSDK, outofmemory in sun-jdk...

EDIT: server is 64-bit, openJDK and Sun are 1.6.0, both 64-bit JVMs.

  • 1
    is it a 64 bit machine? are sdks 64 bit? Oct 9, 2012 at 23:32
  • Yes on both questions, updated post.
    – Mathias
    Oct 10, 2012 at 7:30
  • You can try this Java option : -XX:+AggressiveHeap. And you also need to be able to write to the Java temp dir.
    – drcelus
    Oct 10, 2012 at 8:55
  • hey drcelus, thanks for responding. I'm still puzzled why i'd need those things, when everything works fine in OpenJDK...
    – Mathias
    Oct 10, 2012 at 10:57

1 Answer 1


going to answer my own question since i figured this one out in the end:

As it turns out, we had set the xmx and xms, However, we had NOT set -XX:MaxPermSize.

This one is per default 256mb in openJDK, but only 128mb in SunJava. This is what caused it when switching.

After entering -XX:MaxPermSize=256m in catalina.sh all works fine in both JVMs!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .