News for hackers. Stuff that matters.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by hn3333 on Friday May 21, 2021 @02:57AM (#27231243)
It would be very bad if OS memory usage did not return to flat no?
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by hutzlibu on Friday May 21, 2021 @04:06AM (#27231587)
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, like it works, because websites are closed regulary. And because RAM is every increasing. But browse with a older smartphone and you hit the RAM limit very quickly.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by imtringued on Friday May 21, 2021 @06:27AM (#27232316)
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.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by hexo on Friday May 21, 2021 @07:22AM (#27232666)
On the other hand, my browser (Firefox) keeps overflow through 8GB ram few times a day. Sometimes I wish people programmed like we had 512megs in a luxury machines.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by bluefirex on Friday May 21, 2021 @07:54AM (#27232889)
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, likel... by FeepingCreature on Friday May 21, 2021 @07:45AM (#27232813)
I have 32GB of RAM and usually browsers use about 10GB of it. But I do open a stupid amount of tabs.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by slver on Friday May 21, 2021 @07:03AM (#27232542)
Chrome runs a separate process per origin so that adds up almost as fast as Atom
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by pantalaimon on Friday May 21, 2021 @05:07AM (#27231889)
If you close the app the OS should clean up the memory no matter what the app was doing
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by habibur on Friday May 21, 2021 @05:13AM (#27231914)
But closing tab != closing app.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by dokem on Friday May 21, 2021 @10:50AM (#27234749)
In ff and chrome tabs are processes. So aside from resources allocated on behalf of that process by other processes not being cleaned up, the OS will cleanup all the memory that tab told the OS to allocated when closed.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by unnouinceput on Friday May 21, 2021 @05:42AM (#27232082)
Firefox user here, plenty of tabs, Win10 as OS. 3.7 GB before opening the GIF in new tab, 3.8 after opening, 3.7 after closing. Reopening and closing it several times in a row yields the same results, consistently. At least for my setup (Win10 heavily crippled to my own liking) closing tab == closing app in terms of memory gained back.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by hutzlibu on Friday May 21, 2021 @05:52AM (#27232134)
It should be equal when we are talking about webapps.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by DougBTX on Friday May 21, 2021 @06:36AM (#27232368)
It would be fair for a browser to assume that if you’ve just visited one page that you might return soon, and so keep assets in cache for a little while.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by hutzlibu on Friday May 21, 2021 @07:35AM (#27232738)
Well yes, if done right some browsercaching is fine.

But that could pile up quickly, so I am not sure if and how it is done in the various browsers.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by jfoster on Friday May 21, 2021 @05:22AM (#27231957)
I reckon we're probably a lot better off today than in 1995. (Windows 95)
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by boomboomsubban on Friday May 21, 2021 @04:01AM (#27231559)
Depends on what you mean, there is no real reason to blank memory just because a program is exited.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by notrandom on Friday May 21, 2021 @04:04AM (#27231576)
A program should not hold memory anymore when it is no longer running. If it did, that would be an OS memory leak.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by simondotau on Friday May 21, 2021 @04:17AM (#27231641)
A process which doesn't exist cannot hold memory. But the OS can certainly chose to defer the erasure as long as there's no better use for that memory. This is often done to speed up the performance of processes which are frequently quit/stopped and reopened/started.
Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by Elv13 on Friday May 21, 2021 @04:40AM (#27231767)
> A process which doesn't exist cannot hold memory

Not quite. Some leaks are across processes. If your process talk to a local daemon and cause it to hold memory then quitting the client process wont necessarily free it. In a similar way, some application are multi-process and keep some background process active even when you quit to "start faster next time" (of act as spywares). This includes some infamous things like Apple updater that came with iTunes on Windows. It's also possible to cause SHM enabled caches to leak quite easily. Finally, the kernel caches as much as it can (file system content, libraries, etc) in case it is reused. That caching can push "real process memory" into the swap.

So quitting a process does not always restore the total amount of available memory.

Re:Animated GIF uses over 35GB RAM in Acorn on M1 Mac, likel... by ody4242 on Friday May 21, 2021 @04:25AM (#27231678)
I would expect that if you read data - the GIF image in this case - from the block device, it will stay in pagecache, until there is memory pressure.