Animated webP image causes huge RAM usage

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
jamess

Animated webP image causes huge RAM usage

Unread post by jamess » 2020-06-15, 05:07

Hi,

When playing animated webP images (or precisely, short video clips), Pale Moon's RAM usage becomes extremely high. Opening a ~20 MB webP file (for example, this sample file created by the Video Thumbnails Maker) can use over 4 GB of RAM, and hence usually gets Pale Moon killed because of OOM. I also noticed that even if I close the browser immediately after opening the webP, the process won't exit right away. Instead, it takes half a minute for the RAM usage to grow linearly from ~200 MB to over 4 GB and only after that the process terminates.

I am running Pale Moon 28.10.0 (64-bit) Build ID: 20200604221856 on Windows 7, but I can reproduce the issue on Windows 10 as well.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35600
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Animated webP image causes huge RAM usage

Unread post by Moonchild » 2020-06-15, 08:54

Using animated WebP images for video has the same drawbacks as using animated GIFs for video. They are image formats, not video formats. They aren't designed for video and shouldn't be used for video representation because they aren't streaming formats.
For the discussion about animated gif memory usage when abused and resulting OOM see viewtopic.php?f=29&t=24497

Bottom line: don't use animated WebP for this. Use WebM which is designed for video.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

jamess

Re: Animated webP image causes huge RAM usage

Unread post by jamess » 2020-06-16, 03:48

Moonchild wrote:
2020-06-15, 08:54
For the discussion about animated gif memory usage when abused and resulting OOM see viewtopic.php?f=29&t=24497
Thanks for the pointer. I haven't noticed OOM caused by huge GIF, but I see how they are similarly handled.
Moonchild wrote:
2020-06-15, 08:54
Bottom line: don't use animated WebP for this. Use WebM which is designed for video.
Fair enough, I don't like huge animated webP either, so I have image.animation_mode set to "none". But that doesn't stop the frames from being decoded, and hence still causes huge RAM usage despite being unnecessary.

Locked