4 ms·
It would be very bad if OS memory usage did not return to flat no?
by hn3333 5y ago
It would be very bad if OS memory usage did not return to flat no?
- boomboomsubban 5y agoDepends on what you mean, there is no real reason to blank memory just because a program is exited.
- notrandom 5y agoA program should not hold memory anymore when it is no longer running. If it did, that would be an OS memory leak.
- deleted 5y ago[deleted]
- simondotau 5y agoA 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.
- Elv13 5y ago> 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.
- ody4242 5y agoI 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.
- hutzlibu 5y agoIt 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.
- pantalaimon 5y agoIf you close the app the OS should clean up the memory no matter what the app was doing
- habibur 5y agoBut closing tab != closing app.
- unnouinceput 5y agoFirefox 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.
- hutzlibu 5y agoIt should be equal when we are talking about webapps.
- DougBTX 5y agoIt 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.