Client - Configuring memory limits


This article explains the memory usage and configuration of the client. PowerFolder is a Java application. Java imposes a maximum limit to the amount of memory an application can use. This is a safeguard that prevents an application from consuming all of a computer's resources. PowerFolder normally runs perfectly well with the default memory limit. However, if many folders with many files are being managed, this limit can be exceeded and the client will then perform poorly. It is possible to adjust this memory limit. The memory use is heavily influenced by the number of shared files, the actual total size does not matter.

Automatic memory limit detection and configuration on Windows operating systems

On a Windows system the client will automatically detect when the available memory limit is close to being reached, and will display a warning dialog. This dialog provides an option for the client to automatically reconfigure to a higher memory limit. Usually this new limit will then be sufficient. If you are running Windows, you may need to run PowerFolder as an administrator for the reconfiguration to work. To start the client in administrator mode, right-click on the client program shortcut or executable icon and select the Run as administrator option.

By default the client is limited to 1024 MB of memory. If the reconfiguration option is accepted, it will then be limited to 2048 MB(32bit) or 8192(64bit).


Overview:

Manual memory limit configuration on Windows operating systems

The memory limit is written into the configuration file PowerFolder.l4j.ini residing in the client installation directory. It's contents should look similar to the following example:

PowerFolder.l4j.ini
-Xms16m
-Xmx512m
-XX:NewRatio=8
-XX:MinHeapFreeRatio=5
-XX:MaxHeapFreeRatio=10

The -Xmx entry defines the upper memory limit. This can be manually adjusted to any desired value, e.g. -Xmx1024m.

Manual memory limit configuration on Mac OS X operating systems

(warning)On Mac OS X the client will also automatically detect when the available memory limit is close to being reached, but will only display a simple warning about it.

Start the console and navigate to the following file and change the parameters:

/Applications/PowerFolder.app/Contents/app/PowerFolder.cfg
Running the client from command line on Mac OS X
[JavaOptions]
-Xms1g
-Xmx4g (Change the maximum memory for client)

Manual memory limit configuration on Linux operating systems

(warning) On Linux the client will also automatically detect when the available memory limit is close to being reached, but will only display a simple warning about it.

To increase the memory, the bash script used to start the client can be adjusted to use a higher memory limit. The bash script to start the client usually resides in the directory /usr/share/PowerFolder or the directory where you've extracted the client and is called PowerFolder-Client.sh. Open the file in your favorite text editor, adjust the -Xmx parameter in the line below to your needs, and save the file:

Adjusting the memory limit in the PowerFolder-Client.sh file
JAVA_MEM="-Xms64m -Xmx1g -XX:NewRatio=8 -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20"

Manual memory limit configuration when running as a system service

If you encounter crashes caused by hitting the memory limit please edit the file wrapper.conf located in

  • Windows: C:\ProgramData\PowerFolder\service

To increase the memory limit, please adjust the following line to your needs:

Adjusting the memory limit in the wrapper.conf file
wrapper.java.maxmemory=1024

Other tips to reduce memory usage

To reduce memory usage:

  • Enable instant auto-cleanup of uploads and downloads.
    PowerFolder client -> click on a folder -> Transfers -> auto-cleanup interval -> Immediately
  • Reduce the number of files in your folders.
  • Split up big folders into smaller ones.
  • Don't sync/setup folders that do not actually change.
  • Cleanup the folder database.
    PowerFolder client -> click on a folder -> Settings -> Cleanup Database
  • Deactivate the P2P function in client. Configuring connection modes

(info) To perform the tasks above it is required to set up the client to Expert Mode.