Live data from Hacker News

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

twitter.com

111–120 of 342 posts

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

#111

Earlier quoted context omitted.

The framework is part of Apple’s UI stack and indicates a window system/graphics driver bug somewhere in macOS. So it’s probably more than just “an application has a bug”, but still not very interesting until we learn more.

My point was nowhere nearly as interesting as if a specially crafted gif somehow triggered a memory leak in a driver when rendered. The title doesn't make it clear individually opening 730 frames in an the editor is the userspace action exposing an underlying system bug

> My point was nowhere nearly as interesting as if a specially crafted gif somehow triggered a memory leak in a driver when rendered.

There's absolutely no mention of "specially crafted" GIF or "when rendered" in the title. You're projecting your expectations which have nothing to do with the story and are not even hinted at by the title, and choose to be offended that they get betrayed. There are many things I'd like to retort here, but the most important is that it's against the HN guidelines, so it would be good if you stopped.

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

#112
post #96

Earlier quoted context omitted.

If you close the app the OS should clean up the memory no matter what the app was doing

But closing tab != closing app.

It should be equal when we are talking about webapps.

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

#113
post #99

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…

Tangential aside: I wonder if the kernel was running the swapfest on the efficiency cores, and that's what let the system remain so responsive. See also: https://eclecticlight.co/2021/05/17/how-m1-macs-feel-faster-...

Its all very interesting. I wish apple would be less tight lipped about how it all works together. Theres so much guesswork because we don't fully understand how the new arch is being utilized.

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

#114

Earlier quoted context omitted.

Like with the butterfly keyboard? The one which they called a "pig" internally where "lipstick won't fix it", but which they kept selling for years? That totally broke my trust that Apple will address quality issues. https://www.ped30.com/2021/03/23/apple-butterfly-lipstick-pi...

Yes, it sucked that it took so long to redesign it. The bad keyboards started appearing around 2016, and it wasn’t until 2019 that a redesign first appeared, on the new 16” MacBook Pro. But Apple have always been good about free, no-questions-asked, out of warranty replacements for faulty/sticky butterfly keyboards. Not really sure what more you could reasonably want them to do.

>Not really sure what more you could reasonably want them to do.

1 Admit the issue before a class action lawsuit is running

2 Put immediately a statement that there "could" be an issue and it is investigated. Apple kept their mouth shut and the fanboys attacked the people that reported the issues that they use the keyboard wrong or some even claim that is is an anti-Apple conspiracy.

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

#115

Earlier quoted context omitted.

It's a real issue affecting a small minority of users; I have one who has already gone through 20% of their SSD lifetime writes. Here's one of the worse ones back in February: https://twitter.com/marcan42/status/1361847686417190918?s=19 11.4 is in beta so not many people are using it, but at least one of the folks with the issue is running it and said it improved things. Apple were definitely made aware of it, hence…

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 obviously a bug. Even with some Electron apps open and such, I guarantee the working set of active apps was nowhere near the physical RAM size. And so, that's a bug.

Terabytes per day of swap activity is not normal, no matter how much these machines are designed to swap on purpose.

As I said, there's one user with 20% usage as reported by the drive. That's not TBW, that's real (they're at >500 TBW, for what it's worth), and it means that machine is going to have a dead SSD within 2 years if the issue isn't fixed.

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

#116

There’s more information, including a copy of the image, in the forum discussion. The forum seems a bit pokey for me at the moment, though. https://forums.flyingmeat.com/t/memory-consumption-when-open... Gus Mueller (the author of the linked tweet) is the author of the Acorn image editor.

Thanks for the link. The issue seems to be the IOAccelerator framework: > I’ve narrowed it down quite a bit (and submitted it to Apple as FB9112835). > What’s going on is that the IOAccelerator framework has some sort of massive leak in it, where it’s using up 35GB of ram, 25 of which is going to swap (which is why you’re seeing kernel_task flake out). > On intel, the same image only uses 1480K from IOAccelerator.

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

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

#117

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.

I would love to see a CPU Renaissance like this. Back then we had tons of variety, 680x0, x86, Rx000, various lisp machines, Vector computers, VLIW and Multiflow, Sparc, VAX, early ARM, message passing machines, 1-bit multiprocessors, Hypercubes, WD CPUs, and later an explosion of interesting RISC architectures... It was really interesting and enjoyable era.

As someone who programmed at that time, it was also very hard to write even small production programs.

Today I do things in a half-an-hour with Python that would have taken me days - maybe weeks! - to accomplish in 1978.

Each little vendor had their own janky tooling. Compilers cost hundreds of 1970s dollars (until Borland's $49 Turbo Pascal, over $150 in today's money).

Don't get me wrong. I was very unhappy when Intel dominated everything. The fact that ARM, an open-source architecture, is now eating Intel's lunch makes me happy.

But I'd honestly be glad if everyone just settled on ARM and were done with it. It was fun messing with all these weird processors (my first team leader job was writing an operating system for a pocket computer running the 65816 processor!) but it meant that actually generating work was very slow.

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

#118
post #60

Earlier quoted context omitted.

From a codec perspective gifs would be the first thing that came to mind for a poorly optimized format. The only thing it has going for it is simplicity. This is a bit besides the point you're making, but I did a double take at seeing the words "gif" and "pretty optimized" together. I'm also curious as to what this has to do with M1 in particular. Looks to be like a memory allocation issue in the decoder library. But…

"Optimized" in this sense meant that animated gifs can have a frame reference only three pixels of the original image. So an image of 300K with only small movement (think cinemagraphs) wouldn't be much larger. This is a given for movie formats, but at the time the animated GIF came up it was revolutionary. I think the proper phrase should be "animated GIFs can be pretty optimized, taking into account how inefficient…

That's "compressed," not "optimized".

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

#119

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.

Just out of interest, is she still using the same HDD? I find that the performance of older MacBooks are pretty awful under recent version of Mac OS if the storage hardware is the older non-SSD drives. My old $work MacBook with a HDD was thankfully swapped out for a SSD version -- the difference was night and day. Though this SSD machine is starting to slow down noticeably with Big Sur...

Since 2012 the MacBook Pros switched to all Retina and all SSD so yeah it's got an SSD. Anecdotally my 2012 retina is still doing great, also on Big Sur. Battery is pretty shot though.

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

#120
post #54

Earlier quoted context omitted.

Several programs including Firefox Nightly have been reported to blow up, so no it's not limited to a "specific program".

If you're actually following it proves exactly what I'm saying, the gif has nothing to do with it, Firefox isn't blowing up opening that gif, it's hitting whatever framework leak exists. This is like saying "DOCX bluescreens Windows" (which implies something that could possibly be exploited in some pretty scary ways) when in reality Word just happens to make some syscall that bluescreens Windows no matter who calls i…

"DOCX bluescreens Windows" is exactly how your hypothetical scenario would be described.

"Bush hid the facts" is described as a Notepad bug, even though it's a bug in a specific WinAPI function used by Notepad and thus would also affect other programs that used that function. It was discovered on Notepad, it became popular as a bug of Notepad, and so it's considered a Notepad bug.

Post reply on HN