Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
1  
is it a 64 bit machine? are sdks 64 bit? –  Simone Gianni Oct 9 '12 at 23:32
    
Yes on both questions, updated post. –  Mathias Oct 10 '12 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 '12 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 '12 at 10:57
add comment

1 Answer

up vote 0 down vote accepted

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!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.