Permlink Replies: 47 - Pages: 4 [ 1 2 3 4 | Next ] - Last Post: 29 Aug 25, 18:28 Last Post By: JeffTucker
davidekholm

Posts: 3,701
Registered: 18-Oct-2002
Possible fix to WebP out of memory condition
Posted: 13 Aug 25, 21:31
  Click to reply to this thread Reply
I've been in contact with the WebP 3:rd party developer with regards to the out-of-memory condition we've been seeing. Here's an update you may try. It will likely fix the problem according to them. Please test.

Updated file:  files.idrsolutions.com/jdeli-imageio-daily-trial.jar
To install it, rename lib/jdeli-imageio.jar to lib/jdeli-imageio.jar.disabled, then place the downloaded jar file in the lib folder instead. Now restart jAlbum and set it to generate WebP images under settings-Images-Variants. Now see if jAlbum can make your gallery without out-of-memory conditions.

Looking forward to your findings!
RobM

Posts: 3,944
Registered: 4-Aug-2006
Re: Possible fix to WebP out of memory condition
Posted: 13 Aug 25, 21:48   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Typically how many images are needed to get the out of memory issue? Or is it related to the number of variants? Just asking as I don't have huge projects to test it on.
davidekholm

Posts: 3,701
Registered: 18-Oct-2002
Re: Possible fix to WebP out of memory condition
Posted: 13 Aug 25, 22:52   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
I don't really know, but I'd test with at least 4 WebP Variants and 2000 images.
RobM

Posts: 3,944
Registered: 4-Aug-2006
Re: Possible fix to WebP out of memory condition
Posted: 14 Aug 25, 22:48   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Tried new file using new project with Tiger and 4 webP variants. Project has 5 folder with a total of 2,985 files totalling 3.75GB. Got out of memory error around 500th file, previously got the error around 480th file.
java.lang.OutOfMemoryError: Java heap space
	at java.desktop/java.awt.image.DataBufferByte.<init>(Unknown Source)
	at java.desktop/java.awt.image.ComponentSampleModel.createDataBuffer(Unknown Source)
	at java.desktop/java.awt.image.Raster.createWritableRaster(Unknown Source)
	at java.desktop/java.awt.image.BufferedImage.getData(Unknown Source)
	at java.desktop/java.awt.image.ConvolveOp.createCompatibleDestImage(Unknown Source)
	at java.desktop/java.awt.image.ConvolveOp.filter(Unknown Source)
	at se.datadosen.jalbum.AlbumBean.scaleToFit(AlbumBean.java:4969)
	at se.datadosen.jalbum.AlbumBean.scaleToFit(AlbumBean.java:4947)
	at se.datadosen.jalbum.ImageRenderer.processCloseups(ImageRenderer.java:161)
	at se.datadosen.jalbum.AlbumBean.processImage(AlbumBean.java:2334)
	at se.datadosen.jalbum.AlbumBean.lambda$makeAlbumForFolder$10(AlbumBean.java:2039)
	at se.datadosen.jalbum.AlbumBean$$Lambda/0x00003c000101e440.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)
Exception in thread "JavaFX Application Thread" java.lang.OutOfMemoryError: GC overhead limit exceeded
java.io.FileNotFoundException: /Volumes/Archive/Massive jAlbum Project/album/0/slides/0D7CE14C-85FD-4BA2-9504-341E4BA174B1-3200w.webp (No such file or directory)
	at java.base/java.io.RandomAccessFile.open0(Native Method)
RobM

Posts: 3,944
Registered: 4-Aug-2006
Re: Possible fix to WebP out of memory condition
Posted: 14 Aug 25, 23:40   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
Tried reducing number of threads from 8, maximum, to 4. Got a bit further and jAlbum was more responsive but still got out of memory error around 560th file.
davidekholm

Posts: 3,701
Registered: 18-Oct-2002
Re: Possible fix to WebP out of memory condition
Posted: 15 Aug 25, 11:27   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
Thanks Rob. Can you make that project available through a zipped file?
RobM

Posts: 3,944
Registered: 4-Aug-2006
Re: Possible fix to WebP out of memory condition
Posted: 15 Aug 25, 12:11   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
I'll send you an email with a link to dropbox folder, currently uploading it.
davidekholm

Posts: 3,701
Registered: 18-Oct-2002
Re: Possible fix to WebP out of memory condition
Posted: 22 Aug 25, 17:45   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
They're testing now so I assume you can remove the zip file
RobM

Posts: 3,944
Registered: 4-Aug-2006
Re: Possible fix to WebP out of memory condition
Posted: 22 Aug 25, 17:59   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
davidekholm wrote:
They're testing now so I assume you can remove the zip file
Thanks, file deleted. It more or less filled the cloud drive I used.
JeffTucker

Posts: 8,095
Registered: 31-Jan-2006
Re: Possible fix to WebP out of memory condition
Posted: 22 Aug 25, 23:51   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Isn't it time to let go of WebP? This is a dead end. Working to get rid of "out of memory" conditions is like expending effort to improve the efficiency of the boilers on the Titanic.

If you want to improve storage and bandwidth demands, it seems that AVIF is the way to go. Browser support is virtually universal. Support in image-processing software, however, is very spotty. It's either absent entirely, or implemented very badly. But I think it's noteworthy that in June 2025, Photoshop added native support for the format. They must think it's got a future.

The catch, of course, is that storage is cheap - not quite free, but close. Similarly, bandwidth is abundant. You can just feed your site visitors the largest JPG they might need, regardless of display size. There's usually no penalty for doing so. There's not much reason to wrestle with other formats (or with variants).
davidekholm

Posts: 3,701
Registered: 18-Oct-2002
Re: Possible fix to WebP out of memory condition
Posted: 26 Aug 25, 18:17   in response to: JeffTucker in response to: JeffTucker
  Click to reply to this thread Reply
I think AVIF is the way to go. It gives more than 3x the quality for the same file size, or conversely: less than 1/3 of the byte size for the same image quality. I assume that will matter for many, even with today's lower storage costs. Add to that the other advantages of AVIF. The catch is that we don't have any AVIF encoder yet. I hope we can incorporate one soon, then WebP will be a parenthesis.
JeffTucker

Posts: 8,095
Registered: 31-Jan-2006
Re: Possible fix to WebP out of memory condition
Posted: 26 Aug 25, 18:28   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
Could be a long wait.

I was thinking that if the Photoshop encoding is good, a user could add those images to a project, and just use the originals. But that still leaves thumbnail creation out in the cold. And at present, an AVIF image can't be added to a project at all - it's not a recognized file type.
RobM

Posts: 3,944
Registered: 4-Aug-2006
Re: Possible fix to WebP out of memory condition
Posted: 26 Aug 25, 18:29   in response to: davidekholm in response to: davidekholm
  Click to reply to this thread Reply
See https://nixsanctuary.com/ffmpeg-now-supports-jpeg-xl-and-avif-how-to-convert-images/
But note MS Edge at the time of writing, 2022, does not support AVIF.
JeffTucker

Posts: 8,095
Registered: 31-Jan-2006
Re: Possible fix to WebP out of memory condition
Posted: 26 Aug 25, 18:30   in response to: RobM in response to: RobM
  Click to reply to this thread Reply
Browser support is virtually universal now:

https://caniuse.com/avif
davidekholm

Posts: 3,701
Registered: 18-Oct-2002
Re: Possible fix to WebP out of memory condition
Posted: 26 Aug 25, 21:46   in response to: JeffTucker in response to: JeffTucker
  Click to reply to this thread Reply
We'll probably be able to read AVIF images with the latest JDeli library. Replace lib/jdeli-imageio.jar with this one:
https://files.idrsolutions.com/jdeli-imageio-daily-trial.jar
Also do a core update, then jAlbum should recognize/read AVIF files as well.
Legend
Forum admins
Helpful Answer
Correct Answer

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