How to Increase JVM

cancel
Showing results for 
Search instead for 
Did you mean: 
mycelcius
Member II

How to Increase JVM

Jump to solution

Hi All

I recently upgrade my server's RAM from 6 GB to 12 GB, and since the RAM amount is doubled now, I am planning

to increase JVM to 3GB (currently by default is 1GB).

Is there any idea how can I accomplish this matter ?

I tried to alter catalina.sh, but still nothing changed.

Would be nice if anyone let me know how to do this

Thank you very much

Agung

1 Solution

Accepted Solutions
douglascrp
Advanced II

Re: How to Increase JVM

Jump to solution

Using the command line, and inside the tomcat/bin folder, execute:

alfrescoTomcatw.exe //ES//alfrescoTomcat

The bold part has to be the same as the name of the Alfresco's service you see in the Windows Services window.

By doing so, you will be able to set the configurations ‌ told you to set

View solution in original post

16 Replies
afaust
Master

Re: How to Increase JVM

Jump to solution

You will usually find JVM parameters in the setenv.sh script file in the tomcat/bin directory. If you are running a standard Tomcat service (not from Alfresco installer), then you might also have specific configuration files depending on the package for your distribution. E.g. in Ubuntu you could have an /etc/default/tomcat7 in which you can set JVM parameters.

mycelcius
Member II

Re: How to Increase JVM

Jump to solution

Hi Axel, thanks for the answer

I install Alfresco last year with installation pack I downloaded from the site and install it on Windows Server 2008 R2.

I just browse the directory you mentioned (tomcat/bin), but could not find the file you said.

There is no setenv.sh, the only similar file is setenv.bat

These are the content of setenv.bat

set JAVA_HOME=E:\ALFRES~1\java
set JRE_HOME=%JAVA_HOME%
set JAVA_OPTS=++JvmOptions="-XX:+DisableExplicitGC" ++JvmOptions="-XX:+UseConcMarkSweepGC" ++JvmOptions="-XX:+UseParNewGC" ++JvmOptions="-XX:ReservedCodeCacheSize=128m" ++JvmOptions="-Dalfresco.home=E:\alfresco-community" --JvmMs 512 --JvmMx 1024
rem ##### IMAGEMAGICK ENV #####
set JAVA_OPTS=%JAVA_OPTS% --Environment "PATH='E:\alfresco-community/imagemagick\bin;E:\alfresco-community\imagemagick;E:\alfresco-community\java\bin;E:\alfresco-community/postgresql/bin;E:\alfresco-community/common\bin;%PATH%'#MAGICK_HOME=E:\ALFRES~1\IMAGEM~1#MAGICK_CODER_MODULE_PATH=E:\ALFRES~1\IMAGEM~1\modules\coders#MAGICK_CONFIGURE_PATH=E:\ALFRES~1\IMAGEM~1#"

I tried to change catalina.sh, ad restart the server after file modification, but nothing happens. Based on SOLR4 dashboard, the amount of JVM remain the same.

Please kindly advise further steps.

Best Regards,

Agung

cesarista
Customer

Re: How to Increase JVM

Jump to solution

In addition to Axel's comment, in some older versions of Alfresco 4 default installer, you may have JVM options in tomcat/scripts/ctl.sh (instead of setenv.sh). And recently in 201707GA default installer, I saw again default JVM memory settings in ctl.sh, that may overlap if using setenv.sh. I unified JAVA_OPTS in setenv.sh.

Finally, you also may override your JAVA_OPTS in your startup scripts (considering the default extra JVM options used in Alfresco).

Regards.

--C.

mycelcius
Member II

Re: How to Increase JVM

Jump to solution

Hi Caesar

Just check the directory you mentioned, and found only 2 files, no flle named ctl.sh

Attached is the screenshot.

Any other idea?

Best Regards,

Agung

mycelcius
Member II

Re: How to Increase JVM

Jump to solution

In addition, on tomcat/bin --> I found catalina.sh file which at the last line of the content there is this line :

# Setting the Memory Arguments for Tomcat Server
export JAVA_OPTS='-server -Xmx4096m -Xms2048m -Xss1024k -XX:MaxPermSize=256m -XX:NewSize=4g -Dfile.encoding=UTF-8'

Is this the line used to alter the JVM RAM allocation ?

The bold one had been changed in order to change JVM RAM allocation to 4GB (default was 1024m/1GB), but nothing happens. Based on SOLR4 dashboard, the JVM is still at 1GB

cesarista
Customer

Re: How to Increase JVM

Jump to solution

In Windows, it is slightly different, localize the tomcat6w.exe or tomcat7w.exe depending on your Alfresco version, and click right button. Between the tabs you should see a Java tab with JVM memory dialogs. Change it there and restart the Alfresco service.

Regards.

--C.

mycelcius
Member II

Re: How to Increase JVM

Jump to solution

Hi Cesar

Hmmmmm....the odd thing is that I could not find the dile tomcat6w.exe or tomcat7w.exe as you said.

I only able to find tomcat7.exe (without 'w'), but when I right click this exe file, there was no JAVA_OPTS dialog

as you mentioned.

Did I do something wrong?

Best Regards,

Agung

cesarista
Customer

Re: How to Increase JVM

Jump to solution

I will look for it under tomcat/bin, then right click and finally look for a Java tab where putting JVM properties.

Regards. 

--C.

mycelcius
Member II

Re: How to Increase JVM

Jump to solution

Hi Cesar

There is no such file at tomcat/bin directory.

Please see below for the screenshot.

Thanks you and Best Regards,

Agung