3 ms·
Almost all sufficiently complex software leaks memory. If there is a reference to a piece of memory, what is stored in that location will likely last forever.
by hayst4ck 4y ago
Almost all sufficiently complex software leaks memory. If there is a reference to a piece of memory, what is stored in that location will likely last forever.
You could imagine someone doing things like creating a global variable with a queue in it and then putting log lines into that queue, but never taking items out. Because each log line has a reference to it from being in a data structure, and that data structure is referenced by the global scope, that memory will never be released.
In big tech co infrastructure, almost all server software will have memory limits set on the process. The process will either try to allocate more memory and fail or it will be restarted by a process that is watching it.
The other thing to consider is caching. When there is data on the hard drive that your computer needs, it will ask for it. If you ask for the first block of a file, your computer predicts you will probably ask for the rest of the file and optimistically starts loading it into memory before it is asked for. As long as your computer isn't busy with something higher priority, it will likely try to do things now that you might want to do later in order to appear faster.
Web browsers have been known to also optimistically pre-fetch files, although I'm not sure what the current state of optimistic web requests is: https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefe...
Your browser might keep all types of extra data so it can serve your request quickly (form memory) rather than slowly (from some server half way across the world).
Another thing to consider is quality of data. In the past it would have taken forever to download a simple picture, so they were highly compressed and blocky looking/pixelated. Now we can stream things in 4k. As ram increases, so too does the fidelity of our media.
So to summarize, without doing any research at all, I expect the answers are:
Memory leaks (programs bloating over time)
Caching mechanisms (exchanging space used for speed)
Higher quality media (exchanging space used for higher quality)