A gif 10 MB consumes 400 MB of RAM or more.
Moderator: Basilisk-Dev
A gif 10 MB consumes 400 MB of RAM or more.
It was impossible to see this GIF in Basilisk due to its high use of RAM, in this case the GIF has a size of 9.9 MB. In the browser it causes a use of approximately 400 MB of RAM, or more.
https://github.com/mlajtos/mosaic/raw/m ... -0.0.1.gif
If I download it with and I see it with Viewnior, I can see it, and I see that it consumes 50 MB of RAM.
https://github.com/mlajtos/mosaic/raw/m ... -0.0.1.gif
If I download it with and I see it with Viewnior, I can see it, and I see that it consumes 50 MB of RAM.
-
- Moon Magic practitioner
- Posts: 2194
- Joined: 2018-05-05, 13:29
Re: A gif 10 MB consumes 400 MB of RAM or more.
Probably because web browsers are not dedicated media players and have to find compromises, plus the fact that any GIF-encoded image larger that 1MB (and I'm being generous) is always a bad idea.
Get in touch with the person who made the GIF and tell them they are the reason the web is turning to shit more than it was previously.
Get in touch with the person who made the GIF and tell them they are the reason the web is turning to shit more than it was previously.
Re: A gif 10 MB consumes 400 MB of RAM or more.
Thanks for the suggestion, I already made the corresponding report to the creator of the GIF file.
While the problem persists, I can block it with uBlock.
While the problem persists, I can block it with uBlock.
-
- Pale Moon guru
- Posts: 35650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: A gif 10 MB consumes 400 MB of RAM or more.
Abusing the gif image format for pseudo-video has its drawbacks (primarily that browser will treat it as an image and not as streaming media). the 400MB will be used by storing decoded "frames" in memory as is normal for short animated images, for performance reasons.
All modern browsers support a variety of video formats using the <video> tag -- which are, in fact, often even smaller than videos encoded as gifs!
Also, I'm sure this has been discussed at least a few times on this forum already. Did you even try to search?
All modern browsers support a variety of video formats using the <video> tag -- which are, in fact, often even smaller than videos encoded as gifs!
Also, I'm sure this has been discussed at least a few times on this forum already. Did you even try to search?
"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
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Moon Magic practitioner
- Posts: 2860
- Joined: 2012-06-28, 01:20
Re: A gif 10 MB consumes 400 MB of RAM or more.
Yes, I searched, but I did not find much, for example, I found the next topic, that talks about the CPU it uses when it closes a tab with gifs, but not on the RAM using the gif... As I am reading, that was not a browser problem, is that the user entered a community of criptominers.Moonchild wrote: ↑2021-11-18, 19:17Abusing the gif image format for pseudo-video has its drawbacks (primarily that browser will treat it as an image and not as streaming media). the 400MB will be used by storing decoded "frames" in memory as is normal for short animated images, for performance reasons.
All modern browsers support a variety of video formats using the <video> tag -- which are, in fact, often even smaller than videos encoded as gifs!
Also, I'm sure this has been discussed at least a few times on this forum already. Did you even try to search?
viewtopic.php?f=61&t=19229
A possible implementation that occurs to me mentally, is as each frame is decoded, that there is an array by pixel, and the number of paintings that are equal.
Pixel 0,0 -> (#0f0,10)(#f00,5), means that (x: 0, y: 0) is equal for 10 frames green, and 5 frames red... I do not know if this would save RAM.
-
- Pale Moon guru
- Posts: 35650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: A gif 10 MB consumes 400 MB of RAM or more.
"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
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
Re: A gif 10 MB consumes 400 MB of RAM or more.
Well, I had searched for Basilisk, not Palemoon, that's why I had not found many results.
Another problem is that I have to close the tab before you fill out all the memory, so I avoid the browser freezing if I arrive on time... In case of being able to close the tab, continue occupying memory, then to vacate it, the only solution is to restart the browser.
I installed the extension to pause the gifs, Toggle animated GIFs, It serves that when loading the page, those gifs, do not move, but that does not prevent 400 MB from loading in the RAM for the gifs 10 MB.
I think that programmatically, each box could be kept in memory, but compressed, will this affect the performance a lot? If the RAM read faster than a hard drive, I think not much.
Another problem is that I have to close the tab before you fill out all the memory, so I avoid the browser freezing if I arrive on time... In case of being able to close the tab, continue occupying memory, then to vacate it, the only solution is to restart the browser.
I installed the extension to pause the gifs, Toggle animated GIFs, It serves that when loading the page, those gifs, do not move, but that does not prevent 400 MB from loading in the RAM for the gifs 10 MB.
I think that programmatically, each box could be kept in memory, but compressed, will this affect the performance a lot? If the RAM read faster than a hard drive, I think not much.
You do not have the required permissions to view the files attached to this post.
-
- Knows the dark side
- Posts: 4983
- Joined: 2015-12-09, 15:45
Re: A gif 10 MB consumes 400 MB of RAM or more.
What makes more sense - asking websites to not abuse the GIF format, or further enabling such behavior by changing browser code?
"One hosts to look them up, one DNS to find them and in the darkness BIND them."
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Re: A gif 10 MB consumes 400 MB of RAM or more.
The gif format needs to just die off..
Re: A gif 10 MB consumes 400 MB of RAM or more.
The problem is that it is a GitHub Markdown (readme.md file), I do not know if it is allowed to insert embedded videos in that format, perhaps accept webm / webp.
I saw that JustOff published this link that shows that in Firefox this was solved in 2018 (4 years ago).
viewtopic.php?f=5&t=24497&hilit=gifs#p190978
https://bugzilla.mozilla.org/show_bug.cgi?id=523950
So, does that serve as a guide to solve it in Basilisk?
-
- Knows the dark side
- Posts: 4983
- Joined: 2015-12-09, 15:45
Re: A gif 10 MB consumes 400 MB of RAM or more.
Did you even read the rest of that thread?
"One hosts to look them up, one DNS to find them and in the darkness BIND them."
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Re: A gif 10 MB consumes 400 MB of RAM or more.
Yes, I read it, I see that they propose a Zip Bomb, but there was the thread end and that possibility was not debated.
Code: Select all
I mean, an option to prevent excessive memory usage. It looks like zip-bomb for me...
Another thing that I would like is that the browser detects when it is about to run out of memory, in that case, to dispense memory and stops the gif load. In this way the operating system would continue to work and I do not have to restart the computer.
-
- Knows the dark side
- Posts: 4983
- Joined: 2015-12-09, 15:45
Re: A gif 10 MB consumes 400 MB of RAM or more.
You completely blew over Moonchild's detailed reply and just jumped to the end didn't you?
"One hosts to look them up, one DNS to find them and in the darkness BIND them."
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Re: A gif 10 MB consumes 400 MB of RAM or more.
I read the answer, I understand that it is being abusing the gif as video, but also by that abuse crash the browser, and I think it's a good idea to prevent the load, in uBlock you have to choose that option for each site, I do not see how to block them at all.
Being Github, I understand that you have to suggest the author of the gif that changes it, but perhaps with another gif that is not possible. For this reason the Basilisk browser unusable the operating system unusable until the computer is closed or restarted.
The problem exists in Basilisk, the browser has chosen it for its small memory usage compared to Firefox, but other browsers, with fewer features, such as the author's browser, of the gif, Mosaic, has the problem solved, I do not know the exact cause , it can be because it uses another rendering engine, I do not know.
Maybe in 2020 it seemed a complicated task to solve it, but maybe now it is not so much, now there are more ideas like the ones I am describing. What I do not know is, if the opinion changed about it.
Being Github, I understand that you have to suggest the author of the gif that changes it, but perhaps with another gif that is not possible. For this reason the Basilisk browser unusable the operating system unusable until the computer is closed or restarted.
The problem exists in Basilisk, the browser has chosen it for its small memory usage compared to Firefox, but other browsers, with fewer features, such as the author's browser, of the gif, Mosaic, has the problem solved, I do not know the exact cause , it can be because it uses another rendering engine, I do not know.
Maybe in 2020 it seemed a complicated task to solve it, but maybe now it is not so much, now there are more ideas like the ones I am describing. What I do not know is, if the opinion changed about it.
-
- Pale Moon guru
- Posts: 35650
- Joined: 2011-08-28, 17:27
- Location: Motala, SE
Re: A gif 10 MB consumes 400 MB of RAM or more.
If your OS becomes sluggish/unresponsive because 400 MB is too much memory usage and you start swapping then maybe you should consider using a normal amount of RAM in your PC for 2020 instead of asking that we go out of our way for a corner case of abuse of an image format. Also, there are some proposed workarounds in the other threads if you'd care to actually try them instead of going on here.
"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
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite
-
- Moon Magic practitioner
- Posts: 2194
- Joined: 2018-05-05, 13:29
Re: A gif 10 MB consumes 400 MB of RAM or more.
Apparently that guy responded, saying that WebM is not universally supported. Considering that GitHub can barely be usable by browsers not supporting WebM, I wonder what exactly he's trying to target.
Also, he said that GIF autoloops unlinke videos and he would be correct... if his showcase had any reason to autoloop. It's not a real animation but a showcase: you don't need it to loop, but you need it to provide a high quality encoding so that viewers can see with as much details and the he least annoyance as possible, what you are trying to showcase.
It's fine to let people start the video when they want to, especially when they don't have to download the actual data until "play" is pressed. They can also go back in time if they missed something instead of waiting for the loop to restart, not to mention you can fit more time in less data.
GIF is the worst possible format for a showcase, "thank you for a good chuckle" indeed.
Also, he said that GIF autoloops unlinke videos and he would be correct... if his showcase had any reason to autoloop. It's not a real animation but a showcase: you don't need it to loop, but you need it to provide a high quality encoding so that viewers can see with as much details and the he least annoyance as possible, what you are trying to showcase.
It's fine to let people start the video when they want to, especially when they don't have to download the actual data until "play" is pressed. They can also go back in time if they missed something instead of waiting for the loop to restart, not to mention you can fit more time in less data.
GIF is the worst possible format for a showcase, "thank you for a good chuckle" indeed.
Re: A gif 10 MB consumes 400 MB of RAM or more.
There are two ways, one is having a better computer, at the moment it is the only one I have, I can not buy another better, the other is not visiting the site, but that is not the only place with big gif, the internet is full of images like this.Moonchild wrote: ↑2021-11-19, 11:46If your OS becomes sluggish/unresponsive because 400 MB is too much memory usage and you start swapping then maybe you should consider using a normal amount of RAM in your PC for 2020 instead of asking that we go out of our way for a corner case of abuse of an image format. Also, there are some proposed workarounds in the other threads if you'd care to actually try them instead of going on here.
The next parameter apparently does not stop memory consumption, only shows the detained image after loading it completely.
Code: Select all
about:config > image.animation_mode = none
At least, I would like the browser to make a necessary calculation of the required memory before showing the gif, if it exceeds free memory, then it should not show it.
I forgot to insert the link of the problem reported in Github, I leave it in case someone else wants to see it.
https://github.com/mlajtos/mosaic/issues/49
What the author of the gif answered me, among other things, was the following:.. As preferably, if you want to see more repository things, have uBlock enabled, with the option, "Click to block large media elements on this site" if Basilisk is used and enough memory is available... Fortunately on the subject, there is no gif, so you can see the discussion correctly.
Then, in my case the problem is with the gif, but there are also people who have problems with the mp4... If the owner wants to change it to mp4, I would have to choose an adequate codec, since that format accepts different variants of codecs.One time I got a request to change embedded video from MP4 to something else because the user didn't have codecs for MP4 on his system.
I mean, Github is not a strange page to which no one visits, is very visited, it may be that just that repository is not very visited, and that maybe I am not the only one who has such an old computer that visits pages with large gifs.