Skip to main content
Code42 Support

Increasing Java Heap Space For Your Code42 Environment

Applies to:
  • CrashPlan PROe
As the number of users and devices in your Code42 environment increases, the amount of Java Virtual Machine (JVM) heap space memory consumed on your enterprise server(s) will also increase.  If your enterprise server runs out of heap space, it will be necessary to increase the maximum heap space setting. This tutorial explains how to increase the amount of memory allocated to your Code42 environment's JVM heap space.

Applies To

All Code42 environments running Java versions 1.6+

Before You Begin

  • You should be sure that the cause of the problem you are trying to solve is caused by a lack of heap space, rather than lack of RAM, disk I/O, network bandwidth, or other system resources. For assistance with confirming this root cause, contact our Customer Champions​.
  • You should have a basic understanding of "garbage collection" and the JVM memory management cycle.
  • Determine the current amount of installed RAM on your sever.

Considerations

  • If your server hardware does not have sufficient RAM installed, increasing the Java heap space may be ineffective or even reduce overall performance.
  • Java "out of memory" (OOM) errors can occur when the JVM attempts to use more memory than is allocated by the Java environment's -Xmx parameter
  • This procedure requires you to restart the enterprise server.
  • This procedure requires access to your enterprise server. For environments with managed appliances, please contact sales.

Steps

Step One: Determine Current Java Heap Space Allocation

Before changing the Java heap space setting, determine the current heap space setting by following the steps below:

Linux And Solaris Servers

  1. Open the Code42 environment's main installation directory
    Default locations are listed in the File & Folder Hierarchy
  2. Locate the .proserverrc file
    • If your server has a .proserverrc file, open it in a plain text editor
    • If your server does not have a .proserverrc file, open the /bin/proserver startup script (within the main installation directory) in a text editor
  3. Locate the line beginning with the parameter JAVA_MEM_ARGS
    Example: JAVA_MEM_ARGS="-Xss256k -Xms256m -Xmx1024m"
  4. Make note of the argument beginning with -Xmx
    • This argument indicates the current Java heap space setting
    • In the above example, this argument is -Xmx1024m, indicating a Java heap space setting of 1024 megabytes

Windows Servers

  1. Open the Code42 environment's main installation directory
    Default locations are listed in the File & Folder Hierarchy
  2. Open the CrashPlanPROServer.ini file in a plain text editor
  3. Locate the line beginning with the parameter Virtual Machine Parameters
    Example: Virtual Machine Parameters=-Xrs -Xmx1024M -Xss128K -Dapp=CPServer -Ddrools.compiler=JANINO
  4. Make note of the argument beginning with -Xmx
    • This argument indicates the current Java heap space setting
    • In the above example, this argument is -Xmx1024m, indicating a Java heap space setting of 1024 megabytes

Mac OS X Servers

  1. Open the enterprise server's process initialization directory (/Library/LaunchDaemons)
  2. Open the com.crashplan.proserver.plist file in a plain text editor
  3. Locate the key <key>ProgramArguments</key>
  4. Make note of the key containing  -Xmx
    • This argument indicates the current Java heap space setting
    • The default string is <string>-Xmx1024m</string>, indicating a Java heap space setting of 1024 megabytes

Step Two: Decide If Heap Space Increase Is Possible

We recommend increasing the Java heap space only up to one-half of the total RAM available on the enterprise server. Increasing the Java heap space beyond that value can cause performance problems.

As an example, if your server has 16 GB of RAM available, then the maximum heap space you should use is 8 GB.

Step Three: Modify Startup File To Increase Java Heap Space

If a Java heap space increase is possible for your enterprise server, increase the maximum Java heap space by following the appropriate steps for your operating system:

Plain Text Editors 
Use a plain text editor, such as Vi, VIM, emacs, Text Wrangler, Notepad++, TextMate, etc., to make these changes.
Word processors, such as Wordpad, Word, Pages, or OpenOffice Writer, can add formatting characters to plain text files and should be avoided.

Linux And Solaris Servers

Under a Linux installation of the Code42 environment, there are two ways to increase the Java heap space:

  • Modify the .proserverrc file in the main installation directory
    • Changes to .proserverrc will persist if you reinstall the Code42 environment
  • Modify the proserver startup file in <installation_directory>/bin
    • Changes to proserver startup file will not persist if you reinstall the Code42 environment
Recommended Procedure
In most cases, we recommend using the .proserverrc method because any arguments in the .proserverrc file will override the same arguments in the proserver startup script. If your server does not currently have a .proserverrc file, you may create one. In that case, make sure that the permissions on .proserverrc allow the Code42 environment to read the file.
Method One: Modify .Proserverrc File
  1. Open the Code42 environment's main installation directory
    Default locations are listed in the File & Folder Hierarchy
  2. Open .proserverrc in a plain text editor
  3. Locate the line beginning with the parameter JAVA_MEM_ARGS
  4. Change the -Xmx argument of the JAVA_MEM_ARGS line to reflect the desired heap space. Two examples:
    • This argument would set the Java heap space to 1 GB (1024 MB):
      JAVA_MEM_ARGS="-Xss256k -Xms256m -Xmx1024m"
    • This argument would set the Java heap space to 4 GB:
      JAVA_MEM_ARGS="-Xss256k -Xms256m -Xmx4g"
  5. Save the changes to the file
  6. Restart the enterprise server

Method Two: Modify Proserver Startup Script
Changes And Code42 Environment Reinstallation
Note that the changes in this method will not persist if you reinstall the Code42 environment, and you will need to repeat the modification after a reinstallation.
  1. Open the Code42 environment's main installation directory
    Default locations are listed in the File & Folder Hierarchy
  2. Navigate to <installation_directory>/bin
  3. Open the proserver startup script in a plain text editor
  4. Locate the line beginning with the parameter JAVA_MEM_ARGS
  5. Change the -Xmx argument of the JAVA_MEM_ARGS line to reflect the desired heap space. Two examples:
    • This argument would set the Java heap space to 1 GB (1024 MB):
      JAVA_MEM_ARGS="-Xss256k -Xms256m -Xmx1024m"
    • This argument would set the Java heap space to 4 GB:
      JAVA_MEM_ARGS="-Xss256k -Xms256m -Xmx4g"
  6. Save the changes to the file
  7. Restart the enterprise server

Windows Servers

Changes And Code42 Environment Reinstallation
Note that the changes in this method will not persist if you reinstall the Code42 environment, and you will need to repeat the modification after a reinstallation.
  1. Open the Code42 environment's main installation directory
    Default locations are listed in the File & Folder Hierarchy
  2. Open the CrashPlanPROServer.ini file in a plain text editor
  3. Locate the line beginning with the parameter Virtual Machine Parameters
  4. Change the -Xmx argument of the Virtual Machine Parameters line to reflect the desired heap space. Two examples:
    • This argument would set the Java heap space to 1 GB (1024 MB):
      Virtual Machine Parameters=-Xrs -Xmx1024M -Xss128K -Dapp=CPServer -Ddrools.compiler=JANINO
    • This argument would set the Java heap space to 4 GB:
      Virtual Machine Parameters=-Xrs -Xmx4G -Xss128K -Dapp=CPServer -Ddrools.compiler=JANINO
  5. Save the changes to the file
  6. Restart the enterprise server

Mac OSX Servers

Changes And Code42 Environment Reinstallation
Note that the changes in this method will not persist if you reinstall the Code42 environment, and you will need to repeat the modification after a reinstallation.
  1. Open the Code42 environment's process initialization directory (/Library/LaunchDaemons)
  2. Open the com.crashplan.proserver.plist file in a plain text editor
  3. Locate the key beginning with the parameter ProgramArguments
  4. Change the -Xmx argument string within the ProgramArguments key to reflect the desired heap space. Two examples:
    • This key would set the Java heap space to 1 GB (1024 MB):
      <string>-Xmx1024m</string>
    • This key would set the Java heap space to 4 GB:
      <string>-Xmx4g</string>
  5. Save the changes to the file
  6. Restart the enterprise server

Step Four: Verify Heap Space Change

Tested for Linux, Mac OS X, and Solaris only

You can verify that the JVM is using the increased Java heap space:

  1. Open a terminal window
  2. Enter the following command:
    ps -ef | grep java | grep Xmx
  3. Review the command output
    • For example:
      root     25624     1  4 09:08 pts/2    00:16:23 /usr/bin/java -Dapp=CPServer -server -Dnetworkaddress.cache.ttl=300 -Djava.net.preferIPv4Stack=true -Ddrools.compiler=JANINO -Dfile.encoding=UTF-8 -Dc42.native.md5.enabled=false -XX:+DisableExplicitGC -XX:+UseAdaptiveGCBoundary -XX:PermSize=256m -XX:MaxPermSize=256m -Xss256k -Xms256m -Xmx1024m -jar /opt/proserver/lib/com.backup42.app.jar -prop conf/conf_proe.properties -prop conf/conf_local.properties -config conf/conf_proe.groovy -config conf/conf_local.groovy
    • The argument beginning with "-Xmx" will give you the value of the current Java heap space. In the example above, the value is 1024 MB, or 1 GB.