Thread Locked This thread is locked - replies are not allowed.



Permlink Replies: 0 - Pages: 1
jGromit

Posts: 31,899
Registered: 31-Jan-2006
java.lang.OutOfMemoryError : Java heap space
Posted: 07-Apr-2011 04:41
If you receive this error, it usually indicates that your album project includes some very large images. Panoramics, for example, can be in the 100MB range, and processing them is a challenge. The error simply means that Java has run out of RAM, and needs more to handle these images. To increase the amount of memory allocated to jAlbum, choose Tools, Open Directories, Program directory, then quit the jAlbum application.

If you have a 64-bit version of Windows (which covers most current Windows users), the program directory will be C:\Program Files\jAlbum, and there will be a Jalbum.ini file there. Right-click it and choose Edit. If there is no such option, choose Open with... and choose a text editor (Notepad, for example).

Find the line that begins:
Virtual Machine Parameters=-Xms64M -Xmx4000M ...
Change the -Xmx value from 4000M to 6000M or 8000M. Save the file, close it, and launch jAlbum again.

If you have a 64-bit version of Windows but are still using a 32-bit version of jAlbum for some reason, the program directory will be C\Program Files (x86)\jAlbum. You should uninstall jAlbum completely, and visit the download page - https://jalbum.net/software/download. It will automatically provide you with the correct installer for the 64-bit version of jAlbum.

If you have an older, 32-bit version of Windows, the -Xmx value defaults to 800M. You can increase it to 1200M or 1400M. But if you go much higher than that, jAlbum will fail to launch. A 32-bit operating system just can't address more RAM than that for a single application.

If you have macOS, opening the program directory should show you the Contents subdirectory, where you will find an Info.plist file. Alternatively, you can launch Finder, and go to the Applications directory. Right-click the jAlbum.app bundle and select Show package contents. Now open the Contents subfolder. In either case, double click the Info.plist file to open it for editing.

Find this line, towards the bottom of the file:
<string>-Xmx4000M</string>
Increase the 4000M value to something higher. Save the file, close it, and launch jAlbum again.

If you have Ubuntu, locate the file Jalbum.desktop and edit it. Look for a line like this:
Exec=java -Xmx4000M
Change it to a higher value.

If you are using Console Mode, do the same thing by editing the -Xmx4000M parameter to –Xmx8000M, for example.

Leaving the -Xmx setting at a very high value all the time is discouraged, as it tends to mask memory leaks, and these need to be found and fixed. In some circumstances, it can also lead to unnecessarily high RAM consumption, can slow down the computer when it's forced to swap memory, and can deprive other applications of RAM. So, when you return to creating albums with more typical image files, reset the value to its default.

There is also a way to reduce the amount of memory the application requires. Choose Tools (jAlbum on macOS), Preferences, General, and reduce the Number of threads setting. This will slow down album generation, but it will demand less RAM.

Edited by: jGromit on 05-Apr-2018 10:32
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums