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



Permlink Replies: 0 - Pages: 1
JeffTucker

Posts: 7,362
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 original images. 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 an older, 32-bit version of Windows, the program directory will be C\Program Files (x86)\jAlbum. 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 still can't make your album, it's time for a computer upgrade.

If you have macOS, opening the program directory should show you the Java subdirectory, where you will find a JAlbum.cfg 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, and then the Java subfolder. In either case, open the JAlbum.cfg file in a simple text editor.

In the [JavaOptions] section, change the -Xmx value from 4000M to 6000M or 8000M. 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: JeffTucker on 15-Dec-2020 07:32
Legend
Forum admins
Helpful Answer
Correct Answer

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