Heap space problems

When you are getting heap space errors, such as ‘OutOfMemoryError’, in jAlbum it is because jAlbum is running out of memory. It can happen if you for instance have an album with a large number of images or if you have really large original images.

Give jAlbum more memory

On Windows

To give jAlbum more memory on Windows you can go to Tools -> Open Directories -> Program Directory. Now close the jAlbum application, and open the jalbum.ini file in a text editor.

Find the line that begins with...

 Virtual Machine Parameters=-Xms64M -Xmx4000M ... 

and change the value -Xmx4000M to -Xmx6000M or -Xmx8000M and save the file.

On Mac

To give jAlbum more memory on Mac you can go to Tools -> Open Directories -> Program Directory. That will open the Java folder. Now edit the file "jAlbum.cfg" in a text editor. Look for -Xmx4000M and change it to -Xmx8000M for instance.

Note: the '-Xmx4000M' value above is for example only, the actual value may vary from machine to machine.


On Linux

The default invocation limits heap size to 1200M specified in your Jalbum.desktop file - usually it is in /usr/share/applications/. For allowing larger heap size omit -Xmx1200M from the command. This will allow heap size to grow up to 25% of available physical memory (4G on a machine with 16 G total). You may allow larger heap sizes by specifying huge values, e.g. -Xmx64G.

Limitations

AboutJalbum.png
AboutJalbum2.png

If you are running a 32bit version of jAlbum the value can not be set higher than 1400M. You can check if you are running a 32bit version or a 64bit version if you go to jAlbum-> About jAlbum.


Some general hints on lowering memory usage

  • Lower the # of threads under Preferences (ctrl/cmd+,) -> General.
  • Set the image scaling method under Settings->Images to Medium.
  • Ensure that Use hardware accelerated scaling is checked under Settings->Images->Advanced.

Hints on Garbage Collection Tuning

Recent versions of Java have sensible platform dependent default settings for many parameters relevant to garbage collection, see: Garbage Collection Tuning Guide. Users may want to start with these values and make changes only if required:

- Start with default heap size, which defaults to 25% of physical memory of the machine. Omit -Xmx from the invocation. Specify a higher value only when encountering an out of memory error. This applies only to Linux. On a Windows or macOS platform, the default heap size should always be specified.

- When processing large images or large albums use the Parallel Garbage Collector by specifying -XX:+UseParallelGC. It optimizes throughput and footprint at the cost of maximum pause time. Most systems will exhibit only very short pause times barely noticed by the user. This is already the default setting in Windows installations of jAlbum.