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


Permlink Replies: 11 - Pages: 1 - Last Post: 21 Feb 26, 12:27 Last Post By: davidekholm Threads: [ Previous | Next ]
nigel-aves

Posts: 78
Registered: 23-May-2023
java.lang.OutOfMemoryError: Java heap space
Posted: 18 Feb 26, 19:38
 
  Click to reply to this thread Reply
I've no idea if this is base product or skin. It happened while going through the process of converting everything to AVIF format. Because I've used webp I'm also converting the entire gallery to AVIF (front and back end). Ironically, this is the smallest gallery in size/ number of photographs. I have 64 GB of memory. I did update the Story skin this morning.

Regards - Nigel.

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/java.awt.image.BufferedImage.<init>(Unknown Source)
at net.jalbum.avif.Avif.readFromDecoderIO(Avif.java:269)
at net.jalbum.avif.Avif.read(Avif.java:152)
at net.jalbum.avif.AVIFImageReader.read(AVIFImageReader.java:138)
at se.datadosen.util.ImageLoader.doLoadImage(ImageLoader.java:171)
at se.datadosen.util.ImageLoader.loadImage(ImageLoader.java:104)
at se.datadosen.jalbum.AlbumBean.processImage(AlbumBean.java:2416)
at se.datadosen.jalbum.AlbumBean.lambda$makeAlbumForFolder$8(AlbumBean.java:2133)
at se.datadosen.jalbum.AlbumBean$$Lambda/0x0000000086054f60.call(Unknown Source)
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.runWith(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
RobM

Posts: 3,948
Registered: 4-Aug-2006
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 18 Feb 26, 21:41   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
What is the value of -Xmx in the jAlbum .ini file? With 32GB ram you should be able to increase it. Post on the setting by David: https://jalbum.net/forum/message.jspa?messageID=325542#325542
nigel-aves

Posts: 78
Registered: 23-May-2023
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 18 Feb 26, 22:12   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Here's the line from the .ini file ...

Virtual Machine Parameters=-Xms256M -Xmx8000M

I deleted all files in the /jAlbum-Web-Directory, then ran it again; this time it worked without issues. I had just finished converting two albums, both containing more than 20,000 photographs.
JeffTucker

Posts: 8,197
Registered: 31-Jan-2006
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 18 Feb 26, 22:13   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
nigel-aves wrote:
...I'm also converting the entire gallery to AVIF (front and back end).

Not advisable. You're better off feeding the project the highest-quality JPG's you've got. The recent improvements in the jAlbum core mean that it can produce excellent AVIF output, but reading AVIF is another matter entirely. I wouldn't rely on that.
nigel-aves

Posts: 78
Registered: 23-May-2023
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 18 Feb 26, 22:41   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I agree totally ...

But with the two albums containing over 45,000 photographs (I hate to think how many albums), rebuilding them into JPGs would take an eternity.

Nigel
JeffTucker

Posts: 8,197
Registered: 31-Jan-2006
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 18 Feb 26, 22:59   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
nigel-aves wrote:
I agree totally ...

But with the two albums containing over 45,000 photographs (I hate to think how many albums), rebuilding them into JPGs would take an eternity.

Nigel


I'm not talking about having jAlbum convert the original images. Are your original images not JPG's? If not, why not? Where did they come from?
davidekholm

Posts: 3,914
Registered: 18-Oct-2002
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 20 Feb 26, 04:57   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
I've spotted and fixed one major memory leak during tests on a 6000 image gallery. I can't promise it's the same leak that caused problems for you, but it was introduced in v38, so if you remember that these memory problems started after v38, then this update will most likely fix it. Do a "Perform garbage collection" after a "Make album" to see the amount of used memory. It shouldn't bump up significantly between builds.

To apply the fix, open jAlbum 39.2, then select Tools->External tools->"jAlbum core update" and restart jAlbum when prompted. The splash screen should now read 39.2.2.

Looking forward to your comments!
nigel-aves

Posts: 78
Registered: 23-May-2023
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 20 Feb 26, 20:37   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
David, I ran a sewries to tests. You'll know better than me whether these are acceptable, but I'm not seeing any memory leak. Here are the results:

Make Album reports 29,869 photographs, time reported in Mins:Secs.. (At the end of Make Album, it hides the Make Album dialog behind the main jAlbum screen.)

Memory >> After this run.

Total 288 MB Used: 145.9 MB >> After opening jAlbum

Deleted all files in the web-out directory

Total 616 MB Used: 136.73 MB >>After Make Album. Run time approx. 40:25
Total 288 MB Used: 145.9 MB >> Ran Make Album again, no changes. Run time approx. 1:55

Changed output file type from .avif to .webp

Total 628 MB Used: 142.71 MB >> After Make Album. Run time 21:43
Total 640 MB Used: 149.35 MB >> Ran Make Album again, no changes. Run time 1:46

Changed output file type from .webp to .avif

Total 668 MB Used: 149.44 MB >> After Make Album. Run time 28:49

No change, just a Make Album.

Total 680 MB Used: 151.82 MB >> Ran Make Album again, no changes. Run time approx. 1:21

Selected project that contains just one .webm

Total 588 MB Used: 147.67 MB >>After Make Album. Run time approx. 0:0

Hope this helps.

davidekholm

Posts: 3,914
Registered: 18-Oct-2002
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 21 Feb 26, 00:06   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
That looks really good, doesn’t it? If you get such data now then you shouldn’t get any out of memory reports anymore
nigel-aves

Posts: 78
Registered: 23-May-2023
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 21 Feb 26, 02:52   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Agreed. I was doing pretty much what I did to get the error in the first place.

Good find on your part.

Nigel.
nigel-aves

Posts: 78
Registered: 23-May-2023
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 21 Feb 26, 02:53   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
Memory leak fixed that caused the original issue.
davidekholm

Posts: 3,914
Registered: 18-Oct-2002
Re: java.lang.OutOfMemoryError: Java heap space
Posted: 21 Feb 26, 12:27   in response to: nigel-aves in response to: nigel-aves
 
  Click to reply to this thread Reply
Great. I'll update the installers. Thanks for reporting this.

FYI: With the introduction of Views in v38, I made the AlbumObject tree retain its children throughout the album build in an assumption that this would be beneficial for Views, but it was an incorrect assumption and caused jAlbum to cling onto the whole tree during build. Now the branches (each folder level) are pruned once being processed.

Now, the whole tree should be recreated between builds and freed after each build, but there's obviously another leak to hunt down, but with this adjustment to the behaviour we had prior to v38, the leak is minuscule now.
Legend
Forum admins
Helpful Answer
Correct Answer

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