This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 20 - Pages: 2 [ 1 2 | Next ] - Last Post: 10 Aug 21, 14:44 Last Post By: davidekholm
jimberry

Posts: 560
Registered: 30-Aug-2004
"Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 10:06
 
  Click to reply to this thread Reply
Attachment thread-dump-6.txt (37.0 KB)
I have been getting "java.lang.OutOfMemoryError: Java heap space" messages when making a particular album.

If I just rerun "Make Album" a couple of times, jAlbum eventually processes all the files, but continues to produce the error message.

The resulting album seems to be OK, but it would be interesting to know what is causing the error message.

jAlbum 24.1 Jupiter 40
davidekholm

Posts: 3,649
Registered: 18-Oct-2002
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 10:09   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
The thread dump won't help much here. Run a garbage collection afterwards and tell me what it reports (Tools->External tools->Perform garbage collection"). Try using another skin to see whether this is skin related. Look for images with extraordinary large dimensions. Try setting the image scaling quality to "Medium" to see if it's image size related.
jimberry

Posts: 560
Registered: 30-Aug-2004
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 10:14   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Wow. Only 3 minutes for an answer!!!!!!!!!!!

Here is the Garbage collection report :
Total 337 MB.Used: 95.74 MB

After setting image scaling to medium the error message disappeared !!!!

Thanks :)

Edited by: jimberry on 5 Aug 2021, 16:16
jimberry

Posts: 560
Registered: 30-Aug-2004
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 10:22   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
Using Minimal, the error message appeared again, but all files were processed on the first run.
(I hadn't re-set scaling to medium)
davidekholm

Posts: 3,649
Registered: 18-Oct-2002
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 10:51   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
Sorry, I forgot to say: You need to run that garbage collection after you get the out of memory error.
jimberry

Posts: 560
Registered: 30-Aug-2004
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 13:59   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Yes, that is what I did. Although I hadn't done anything else in jAlbum after the error message, I ran a new "Make album" and then the garbage collection.

But "Medium" scaling method seems to have been the fix.

Marked as answered :)
davidekholm

Posts: 3,649
Registered: 18-Oct-2002
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 14:02   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
jimberry wrote:
Yes, that is what I did. Although I hadn't done anything else in jAlbum after the error message, I ran a new "Make album" and then the garbage collection.

But "Medium" scaling method seems to have been the fix.

Marked as answered :)


Ok, but if your garbage collection report reports the total RAM to be 337 MB AFTER an out-of-memory condition, then I suspect that you need to assign more RAM to the jAlbum process. Adjust the -Xmx setting to 4000M. If it already is at that level, then restart your computer and see if it impoves - your memory could be fragmented, preventing Java from allocating one huge continuous block of memory.
jimberry

Posts: 560
Registered: 30-Aug-2004
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 16:00   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
... ... Adjust the -Xmx setting to 4000M. If it already is at that level, then restart your computer and see if it impoves - your memory could be fragmented, preventing Java from allocating one huge continuous block of memory.
Yes, I am sure that MY memory is fragmented ;)
I have forgotten how to access the -Xmx setting (although I am sure that I have accessed it in the distant past). Should it not be resettable from "Preferences" ?
And I had just updated to jAlbum 24.1 - shouldn't that have set it to -Xmx4000?

The image directory contains 66 items, totalling 422.2 MB

After restarting the computer, and setting the image scaling back to "Smooth", the problem returns.
After stating -
Processing image 39 of39 in VasseWetlands...Done
I then get -
An unexpected error occurred. Please see detailed description below:

java.lang.OutOfMemoryError: Java heap space
at java.desktop/java.awt.image.DataBufferByte.<init>(Unknown Source)
at java.desktop/java.awt.image.Raster.createInterleavedRaster(Unknown Source)
at java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source)
at java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readRaster(Unknown Source)
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.readImageAsRasterAndReplaceColorProfile(JPEGImageReader.java:498)
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:388)
at se.datadosen.util.FileFilters.doLoadImage(FileFilters.java:735)
at se.datadosen.util.FileFilters.loadImage(FileFilters.java:657)
at se.datadosen.jalbum.AlbumBean$StandardImageProcessor.processImage(AlbumBean.java:6208)
at se.datadosen.jalbum.AlbumBean$StandardImageProcessor.processImages(AlbumBean.java:6069)
at se.datadosen.jalbum.AlbumBean$ImageProcessingTask.call(AlbumBean.java:6003)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
jimberry

Posts: 560
Registered: 30-Aug-2004
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 16:13   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
Here is the content from ~/local/share/applications/.jalbum,desktop
(No mention of -Xmx )
Desktop Entry
Name=jAlbum
Comment=Open jAlbum .jap files with jAlbum program
Exec=jAlbum %f
Terminal=false
Type=Application
Icon=jalbum
Categories=AlbumCreator;
StartupNotify=true
MimeType=text/x-text;
GenericNameen_AU=Open .jap files with jAlbum
davidekholm

Posts: 3,649
Registered: 18-Oct-2002
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 18:41   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
My Exec line looks like this:

Exec=/usr/lib/jalbum/jre64/bin/java -Xmx1200m -DuseDesktop=true -jar /usr/lib/jalbum/JAlbum.jar
jimberry

Posts: 560
Registered: 30-Aug-2004
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 5 Aug 21, 19:16   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
I can get by with "image scaling =medium", but surely increasing the available memory shouldn't require access to somewhere the OS doesn't want me to have access to?
davidekholm

Posts: 3,649
Registered: 18-Oct-2002
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 6 Aug 21, 09:28   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
jimberry wrote:
I can get by with "image scaling =medium", but surely increasing the available memory shouldn't require access to somewhere the OS doesn't want me to have access to?

If the file isn't having permissions for you writing to it, just adjust that:

sudo chmod 777 filenameHere

I'm unfortunately not able to tell Java how much RAM its allowed to grab by any other means than the command line parameter -Xmx. If you're running jAlbum on Java 14 then the default amount of max RAM has been increased from 64MB to 1/4 of your computer's available RAM, I believe, so less need for that -Xmx switch.
jimberry

Posts: 560
Registered: 30-Aug-2004
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 6 Aug 21, 18:42   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
It appears that I had left a Gimp XCF file in the image directory as well as the png version. Removing this allowed the full album to be created with "smooth" scaling and no final error message.
davidekholm

Posts: 3,649
Registered: 18-Oct-2002
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 7 Aug 21, 14:15   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
Great!
jimberry

Posts: 560
Registered: 30-Aug-2004
Re: "Make Album" completes but still reports "Java heap space" error
Posted: 7 Aug 21, 14:56   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
However, I still find it puzzling that "Smooth" scaling method resulted in a memory problem but with "Medium" the problem image was just ignored?
Legend
Forum admins
Helpful Answer
Correct Answer

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