Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Depends on what you mean, there is no real reason to blank memory just because a program is exited.


A program should not hold memory anymore when it is no longer running. If it did, that would be an OS memory leak.


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.


> 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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: