AnsweredAssumed Answered

Alfresco Will Not Start Using 64-bit JVM

Question asked by tommorris on Nov 14, 2007
Latest reply on Nov 20, 2007 by tommorris
Hello,

Outline:
I'm installing alfresco in a 64-bit environment,
and I *can* get alfresco to start,
but only if the start-up batch file is tweaked.

Environment:
Multiprocessor/Dual core Intel Xeon, 4GB RAM.
MS Windows Server 2003 R2, Standard x64 Edition, Service Pack 2.
Using 64-bit JVM 1.6u3 (jdk-6u3-windows-amd64)
Using Alfresco 2.1.1 enterprise

The Problem:
A StackOverflowError stack-trace terminates the start-up of tomcat,
meaning no web-app server, no webapp, so no alfresco.

Mitigation:
It appears that 64KB is too small a thread stack size to use for the start-up script, so I changed the parameter "-Xss64k" to "-Xss128k" and alfresco then starts normally.

Summary:
I hope this is helpful to other people, but I'm not sure I really understand the issue.

Why does this work in a 32-bit but not a 64-bit environment?
(I guess the larger addressable space simply consumes more memory)

Does this happen for everyone in a similar scenario?

If so, should alfresco record this as part of the installation documentation?

Can I expect further memory-management issues, because of this change?
(for a web-app, I can see that keeping the thread-stack smallish is preferable)

One more thing. Does anyone know if there is any different between these two JVM options?
-Xss128k    …and…    -XX:ThreadStackSize=128k


Many thanks,
Tom Morris
http://www.ixxus.com
Alfresco Partner.


Diagnostic Info:
I removed the "start" prefix to capture the stack-trace, shown below.

E:\Alfresco>"C:\Java\jdk1.6.0_03\bin\java" -Xms128m -Xmx512m -Xss64k -server -XX:CompileCommand=exclude,org/ap
ache/lucene/index/IndexReader$1,doBody -XX:CompileCommand=exclude,org/alfresco/repo/search/impl/lucene/index/I
ndexInfo$Merger,mergeIndexes -XX:CompileCommand=exclude,org/alfresco/repo/search/impl/lucene/index/IndexInfo$M
erger,mergeDeletions  -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.co
nfig.file="E:\Alfresco\tomcat\conf\logging.properties"   -Djava.endorsed.dirs="E:\Alfresco\tomcat\common\endor
sed" -classpath "C:\Java\jdk1.6.0_03\lib\tools.jar;E:\Alfresco\tomcat\bin\bootstrap.jar" -Dcatalina.base="E:\A
lfresco\tomcat" -Dcatalina.home="E:\Alfresco\tomcat" -Djava.io.tmpdir="E:\Alfresco\tomcat\temp" org.apache.cat
alina.startup.Bootstrap  start
CompilerOracle: exclude org/apache/lucene/index/IndexReader$1 doBody
CompilerOracle: exclude org/alfresco/repo/search/impl/lucene/index/IndexInfo$Merger mergeIndexes
CompilerOracle: exclude org/alfresco/repo/search/impl/lucene/index/IndexInfo$Merger mergeDeletions
java.lang.StackOverflowError
        at java.lang.String.startsWith(String.java:1420)
        at java.lang.String.startsWith(String.java:1451)
        at sun.misc.MetaIndex.mayContain(MetaIndex.java:225)
        at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:744)
        at sun.misc.URLClassPath.getResource(URLClassPath.java:168)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:192)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:222)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:410)

Outcomes