Live data from Hacker News

Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

twitter.com

171–180 of 342 posts

Re: Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

#171

Earlier quoted context omitted.

It sometimes feel like it is a bonus today, if apps bother to clean up their memory at runtime, so maybe that's why parent poster thought it is a good and special thing, that the OS free's the memory of an ended processes. Btw. many people don't seem to know, that also in languages with a garbage collector like Javascript, you can create awesome memory leaks. And I would bet, most websites actually do: it only works,…

I have 32GB of RAM and it sits unused most of the time. Right now I am at 4GB/32GB. It simply isn't a significant source of memory consumption. Open Atom and you can easily get to 500MB for a single application, which is completely wasteful. That browser can run dozens of apps in 4GB.

I also have 32 GB RAM and right now am at 25 GB + 2.4 GB in swap. I'm at around 20 GB most of the time but always have at least 3 Firefox tabs open. Sometimes a buggy process (looking at you, Apple…) decides to go haywire and use 30-60 GB of virtual memory. I don't even notice that until I have a look into the activity monitor. Handling RAM spikes seems to be no issue at least on macOS.

Re: Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

#172
post #143

Who else is excited that we are might revive the 80s Cambrian explosion of different system system and architectures? Back then there were so many options.

Hmmm... the chances for that are pretty slim I'm afraid. "Apple Silicon" is not a new system, it's just one of the large incumbents switching to another architecture (which is also not a first, this now being their fourth architecture, after 680x0, PowerPC and x86). In the desktop/notebook market, Wintel and Apple are firmly entrenched, with only ChromeOS and Linux challenging them - plus a few less significant OSes…

Not only is it an incumbent switching to another architecture; it's an incumbent switching to another incumbent architecture. ARM is older than PowerPC and almost as old as the Macintosh itself; it came out in 1985.

Re: Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

#173
post #116

Earlier quoted context omitted.

Wow. This can explain some of excesive swap usage on M1.

Seems like a poor conclusion to draw with this little information.

People have reported their SSDs filling up (in terms of total writes) much faster on Apple Silicon machines. If IOAccelerator can leak like this then it would definitely explain it. 25GB swap for one image is absurd. Multiply that by a few months of usage. It may not be a smoking gun but it is a fingerprint in the pool of blood.

Re: Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

#175
post #141
post #28

Earlier quoted context omitted.

Wouldn't 4 to 5 years of full-day usage be just fine for worst case life expectancy for a laptop? I've had one that gave up on 3 years, a couple months after warranty ended (that seemed to be quite common for that brand at the time).

Enterprise Thinkpads easily last 10+ years. Although you will need to change the battery at some point. I think my current work laptop is 6-7 years old. My backup laptop is 11 years old.

Still I think a lot of Thinkpads need some parts (often the motherboard!) replaced before they run out of extended on-site repair warranty. The small sample from my co-workers seems to indicate that the rate for that is over 50%. Maybe I just happen to know all the people who use their laptops as shovels.

That said, my 2015 HP Zbook (previously in contracting work, now personal use) still works perfectly, only now with third keyboard, third battery, and a bit of superglue.

Re: Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

#176
post #149

Earlier quoted context omitted.

Browsers and other players will generally be fine, as they render the image progressively. However, editors /processing tools which attempt to load it as a series of frames or a video will usually break, as memory consumption explodes, unless they have a smart disk buffer system to handle it. I wouldn't be surprised if some poorly implemented players were built on top of abstraction layers that end up flattening the…

And this kids, is why we have key and delta frames. We should drop gif support.

Why not cap animated gifs at a maximum duration or file size? GIFs original use cases are already served by formats better suited to the modern era.

Their continued popularity seems due mostly to their historical auto play behavior. One that apps are so reluctant to disrupt we're filling landfills with electronic waste to keep up with ever larger and longer meme animations.

Re: Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

#177
post #8

Even 360MB seemed a bit high to me so I had to open it up in a few apps to get some perspective. Ristretto: 48.8MB. EOG: 51.3MB. ImageMagick: 169MB. Firefox: 305.1MB. Vivaldi: 185.2MB. Edge: 196.5MB. GIMP: 244.8MB. OS memory usage remained relatively flat once app exited. xUbuntu 20.04.

This sort of thing is a known historical attack surface. At one point not too long ago, people were attacking Discord's browser and desktop clients by embedding massive carefully-authored GIF files to exploit the fact that Chromium (thus, Chrome and Electron) decodes GIFs partially or wholly in advance, so the GIF would quickly consume all memory available to the tab/app and either crash it or bog down the system.

I think Discord implemented some measures to guard against those files and Chromium was patched to mitigate this (which is why Edge and Vivaldi are fine), so it's not surprising that something like Safari might struggle with Evil GIFs under certain circumstances as well.

Re: Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

#178

Earlier quoted context omitted.

I still don't see how this can be classed as a bug by anyone other than apple. You have a single case of 10% lifetime usage (plus a 20% one you mention), along with thousands of reports of people with 2-5% - which you also stated was too high - based on your insistence of using TBW (which can vary by up to 10000x depending on the tech) instead of percentage used (supplied by the manufacturer). I had an out of memory…

It is by design, but not that much . That's the point. The machines are designed to use swap and memory compression to greatly enhance responsiveness even with less physical RAM than competitors. And that works well for most users. But there's a bug in the heuristic, and for some users, it starts pathologically swapping. We've seen the numbers go up in the activity monitor. Even while doing ~nothing. Fast. That is ob…

Ironically enough, had swapping not been so fast then runaway RAM usage bugs probably would've been found a lot sooner as they crippled the machine.

Re: Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

#179

Earlier quoted context omitted.

> Apple is pretty good at the planned obsolescence game Nah, they suck at it. My GF is just finishing her bachelors thesis in the living room on my 2013 MBP with 4 GB RAM. First battery, updated all the way from Mavericks to Big Sur. Still supported, still useful and prettier than 80 % machines out there.

You're right. Macs have excellent build quality and are durable as hell. Planned obsolescence with Apple is seen more with iPhones. There was the recent story about Apple slowing down older iPhones via software updates [1] [1]: [ https://www.bbc.com/news/technology-51413724 ]

This isn't a case of planned obsolescence. If anything it's exactly the opposite of that, trying to prolong the useful life of a phone as its battery degrades. This did of course lead to them offering a $29 battery replacement for affected phones (after they were caught doing this).

The lack of communication was a problem but "planned obsolescence" in this case is just tin-foil hat nonsense.

Re: Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likely due to memory leak

#180
post #149

Earlier quoted context omitted.

Browsers and other players will generally be fine, as they render the image progressively. However, editors /processing tools which attempt to load it as a series of frames or a video will usually break, as memory consumption explodes, unless they have a smart disk buffer system to handle it. I wouldn't be surprised if some poorly implemented players were built on top of abstraction layers that end up flattening the…

And this kids, is why we have key and delta frames. We should drop gif support.

i'm pretty surprised apng hasn't really displaced gif, at least not completely. a lot of people don't seem to even be aware pngs are animatable these days
Post reply on HN