CrashPlan - need help editing JVM heap size

The discussion lounge for third-party packages.
Forum rules
Please note the Disclaimer before modifying your Synology Product.
roonie
Trainee
Trainee
Posts: 17
Joined: Wed Apr 10, 2013 1:18 am

CrashPlan - need help editing JVM heap size

Postby roonie » Sun Aug 25, 2013 4:43 pm

Can anyone help me with making the below suggested change to my DS412+ that I found on the Synology Wiki. I'm a Linux newb and stuck. I can SSH to the DiskStation> but do not have the CLI skill to get any further. My CrashPlan cloud backups were running very well until recently when the below constant re-start/disconnect issue started occurring.

Thanks in advance.


"CrashPlan silently crashes, and restarts (sometimes repeatedly) or stops after working for awhile

If there are large or many files in the backup set, it is possible that the Java VM runs out of memory and crashes. This would be evident if a GUI is connected as it will complain about loss of connection. It may be possible to find "Caused by: java.lang.OutOfMemoryError: Java heap space" in /opt/crashplan/log as well.

This situation can be resolved by increasing the maximum heap size for the virtual machine, if the device has enough RAM to support it. The -Xmx switch determines the maximum size, while -Xms is the initial (minimum) size. Note that the maximum size CAN be set larger than installed RAM, which may be necessary in certain cases. Although this may cause swapping, it will only occur if necessary, and the performance loss may not be noticeable depending on workload.

Suggested values for devices with 1GB RAM and 2GB swap, not running any other memory intensive applications: modify the first line in /opt/crashplan/bin/run.conf

from:
SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx512m ...


to:
SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms128m -Xmx1536m ..."
roonie
Trainee
Trainee
Posts: 17
Joined: Wed Apr 10, 2013 1:18 am

Re: CrashPlan - need help editing JVM heap size

Postby roonie » Wed Aug 28, 2013 4:17 pm

I did some more digging and managed to actually resolve my issue and am once again successfully backing up to the cloud. I changed the file /volume1/@appstore/CrashPlan/syno_package.vars by editing in vi to remove the # in front of the command: #USR_MAX_HEAP=XXXX and making XXXX=1536 After editing, I re-started the package. Google searches for basic vi usage and some advice from co-workers saw me through here. Thanks anyway.
meirham
I'm New!
I'm New!
Posts: 2
Joined: Sat Aug 31, 2013 1:58 pm

Re: CrashPlan - need help editing JVM heap size

Postby meirham » Sat Aug 31, 2013 2:03 pm

Roonie,

I think I'm having the same problem as you. Can you explain how you found the file you needed to edit?

/volume1/@appstore/CrashPlan/syno_package.vars

I'm really new at all this, and can't seem to find this file. I can see it if I look through the crashplan GUI but I can't edit it from there. I don't see Volume1 under File Station and when I access my DS through finder it's not there either. I tried changing my prefs through terminal (on my mac) to show hidden files, but that only seemed to affect files on my mac itself, not the DS.

Once I locate it, can I just use textedit on my mac to make the changes you suggest? Or will I be editing through some part of the DSM software?

Thanks a lot.
User avatar
Ametz
Apprentice
Apprentice
Posts: 98
Joined: Wed Dec 12, 2012 5:59 pm

Re: CrashPlan - need help editing JVM heap size

Postby Ametz » Sat Sep 21, 2013 9:34 am

roonie wrote:
from:
SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx512m ...


to:
SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms128m -Xmx1536m ..."


I wonder, what is the Xms that you changed from 20 to 128?
I have always seen posts (as i can remember) to only change Xmx from 512 to *whatever* higher value.

Update (I found out):
The -Xmx switch determines the maximum size, while -Xms is the initial (minimum) size.
Synology: DS2413+, 12X 3TB WD Red Edition, SHR-2 Raid
Computer: AMD Phenom x4 3,4 GHz, RAM 16GB, Geforce GTX 1060, Win 7 Ult x64, HDD: 60GB SSD+1,5TB+1,5TB
HTPC: Intel i5-3570K 3,4GHz, RAM 16GB, Win 7 Ult x64, HDD: 60GB SSD+2TB+700GB
Uranium232
I'm New!
I'm New!
Posts: 1
Joined: Mon Dec 02, 2013 9:38 pm

Re: CrashPlan - need help editing JVM heap size

Postby Uranium232 » Mon Dec 02, 2013 9:43 pm

roonie wrote:I did some more digging and managed to actually resolve my issue and am once again successfully backing up to the cloud. I changed the file /volume1/@appstore/CrashPlan/syno_package.vars by editing in vi to remove the # in front of the command: #USR_MAX_HEAP=XXXX and making XXXX=1536 After editing, I re-started the package. Google searches for basic vi usage and some advice from co-workers saw me through here. Thanks anyway.


USR_MAX_HEAP=1536M

Worked like a champ. Thank you! Make sure to SSH in as the 'root' account (same password as your 'admin' account) to do this.
mattarth
I'm New!
I'm New!
Posts: 4
Joined: Wed Oct 12, 2011 4:10 pm

Re: CrashPlan - need help editing JVM heap size

Postby mattarth » Wed Dec 04, 2013 1:48 pm

Success! First I followed this advice:

roonie wrote:I did some more digging and managed to actually resolve my issue and am once again successfully backing up to the cloud. I changed the file /volume1/@appstore/CrashPlan/syno_package.vars by editing in vi to remove the # in front of the command: #USR_MAX_HEAP=XXXX and making XXXX=1536 After editing, I re-started the package. Google searches for basic vi usage and some advice from co-workers saw me through here. Thanks anyway.


I did the above, but it didn't fix the issue, I was still getting constant restarts. So then I followed the original advice:

roonie wrote:Suggested values for devices with 1GB RAM and 2GB swap, not running any other memory intensive applications: modify the first line in /opt/crashplan/bin/run.conf

from:
SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx512m ...


to:
SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms128m -Xmx1536m ..."


That solved it. So I changed the limit in both places and it works fine again now. This was a CrashPlan installation from the Package Manager in DSM. I had recently added a lot of large files to the backup settings, which was almost certainly causing it to crash and restart.

If you don't like using vi, you can always copy the file you need to edit to a place accessible through DSM, download it, edit it, then upload it and copy it back to where it was originally from.

For instance to copy the run.conf file to a folder called Downloads in Bob's user directory use this:

Code: Select all

cp /opt/crashplan/bin/run.conf /volume1/homes/Bob/Downloads/run.conf


and once it's been edited, backup the original and then copy it back:

Code: Select all

mv /opt/crashplan/bin/run.conf /opt/crashplan/bin/run.conf_backup
cp /volume1/homes/Bob/Downloads/run.conf /opt/crashplan/bin/run.conf
Roms
I'm New!
I'm New!
Posts: 3
Joined: Fri Aug 01, 2014 4:16 pm

Re: CrashPlan - need help editing JVM heap size

Postby Roms » Sat Aug 02, 2014 3:02 pm

Hi,
I can't find /opt/crashplan/bin (not even just /opt)... I have a /volume1/@appstore/CrashPlan/bin in which I have a run.conf, but which is empty... Any idea where else can be the real run.cof on my Synology 214Play / DSM-5 (strange I don't have /opt at all...)?
Thanks !
wasrgm
I'm New!
I'm New!
Posts: 1
Joined: Sat Jul 20, 2013 2:30 am

Re: CrashPlan - need help editing JVM heap size

Postby wasrgm » Sun Aug 24, 2014 12:28 am

Roms wrote:Hi,
I can't find /opt/crashplan/bin (not even just /opt)... I have a /volume1/@appstore/CrashPlan/bin in which I have a run.conf, but which is empty... Any idea where else can be the real run.cof on my Synology 214Play / DSM-5 (strange I don't have /opt at all...)?
Thanks !



The run.conf file is at: /Volume1/@appstore/CrashPlan/Bin/run.conf

You will want to copy the file using ssh (logged in as root).

I copied it to /volume1/homes/run.conf and then edited the file per the instructions listed in the posts above and save it.

I then copied it back to the original location, stopped and restarted crashplan in DSM and I am up and running. Thanks Everyone for your guidance. Much appreciated.

If you need help with SSH commands, I suggest you look here: http://www.siteground.com/tutorials/ssh/ssh_copying.htm
Roms
I'm New!
I'm New!
Posts: 3
Joined: Fri Aug 01, 2014 4:16 pm

Re: CrashPlan - need help editing JVM heap size

Postby Roms » Wed Aug 27, 2014 8:10 pm

Thanks
ced78
I'm New!
I'm New!
Posts: 1
Joined: Sun Jan 18, 2015 4:42 pm

Re: CrashPlan - need help editing JVM heap size

Postby ced78 » Sun Jan 18, 2015 4:53 pm

After upgrading to the 3.6.7 I figured out the java heap size was back the default 1024M, stopping the engine again and again.
The solution given by code42 was not working (double click on the crash plan symbol and command line "java mx 3072, restart" for 3GB of memory allocated.) Each restart the engine was back to the default 1024M.

It changed the parameters in 3 different files and it look good now. I need 3GB (3072M) and use a 1813+ with 4GB.
Changes must be done when engine is stopped. Please save a copy of your file before making a change.

In /volume1/@appstore/CrashPlan/syno_package.vars

DiskStation> cat syno_package.vars
#uncomment to expand Java max heap size beyond prescribed value (will survive upgrades)
#you probably only want more than the recommended 1024M if you're backing up extremely large volumes of files
USR_MAX_HEAP=3072M
# you can change to your value here

MANIFEST_PATH_SET=True

in /volume1/@appstore/CrashPlan/conf/my.service.xml

<javaMemoryHeapMax>3072m</javaMemoryHeapMax>

in /volume1/@appstore/CrashPlan/bin/run.conf

SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx3072m -Djava.net.preferIPv4Stack=true -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0 -Dc42.native.md5.enabled=false -Djava.io.tmpdir=/volume1/@tmp"

This command line will confirm the change has taken effect.

DiskStation> ps | grep java | grep Xmx

27607 root 3369m S N /var/packages/JavaManager/target/Java/jre/bin/java -Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx3072m -Djava.net.prefe
slartybart
I'm New!
I'm New!
Posts: 4
Joined: Thu Feb 12, 2015 10:29 pm

Re: CrashPlan - need help editing JVM heap size

Postby slartybart » Mon Sep 04, 2017 10:02 am

For those struggling with increasing memory after the migration to PRO, the new locations for the files listed above are as follows:

volume1/@appstore/CrashPlanPRO/syno_package.vars
/volume1/@appstore/CrashPlanPRO/bin/run.conf

Return to “Third-party Packages”

Who is online

Users browsing this forum: No registered users and 4 guests