3 ms·
This is awesome. I'm working my way through The Garbage Collection Handbook and it's always nice to see a GC link on HN. "What does “low on memory” even mean,
by youdontknowtho 7y ago
This is awesome. I'm working my way through The Garbage Collection Handbook and it's always nice to see a GC link on HN.
"What does “low on memory” even mean, especially on modern computers with near-infinite virtual memory?" is a question that I've been wondering about for a while.
- Alupis 7y agonear-infinite virtual memory, yes, but there's practical limits to what the hardware can support. After exhausting actual RAM, and swap - there's nowhere else to put things... so you'll crash anyway.
- tempguy9999 7y agoIf you mean the jones/lins book, it's excellent[0]. Fully recommended to all. [0] https://www.amazon.co.uk/gp/product/0471941484 https://www.amazon.co.uk/gp/product/0471941484 I think there's a 2nd edition but I can't find it.
- mangamadaiyan 7y ago> 2nd edition but I can't find it Perhaps you're referring to this one [1]? [1] https://www.amazon.co.uk/Garbage-Collection-Handbook-Management-Algorithms/dp/1420082795/ https://www.amazon.co.uk/Garbage-Collection-Handbook-Managem...
- tempguy9999 7y agoThanks, I think I was confusing that with the 2nd ed, which doesn't seem to exist (in fact there is a 1999 2nd printing of the 1996 book with a different cover but with the same ISBN, just to make things worse, https://www.cs.kent.ac.uk/people/staff/rej/gc.html https://www.cs.kent.ac.uk/people/staff/rej/gc.html, so if you want to buy the later one which incorporate the errata from the first printing, check his website first. Publishers do make a mess of things sometimes). Jones' website https://www.cs.kent.ac.uk/people/staff/rej/gc.html https://www.cs.kent.ac.uk/people/staff/rej/gc.html is excellent too.
- kazinator 7y agoBasically, the memory management on modern computers with virtual memory has to self-impose some constraints to create internal pressure to clean up memory. The implementation may have the option to set some absolute maximum heap size. Or other parameters that set growth hurdles. The memory management tries to keep things within a given hurdle, but when it's obvious that more memory is needed, it changes to another hurdle: e.g. it allocates a new heap area from the OS with a big allocation. There is a performance trade off there, because if lots of memory is available, but we tighten the belt anyway, the application may perform less well due to running garbage collection when it could have gotten away with allocating more external memory. On the other hand, the application is then less of a "pig" with regard to other things in the system.
- user5994461 7y agoMemory is a very finite resources actually. Pretty sure virtual memory and over allocation is a major issue with virtual machines and containerization nowadays. Software preempt huge amount of memory because it's assumed to be unlimited free virtual memory. Except the software is running within a container or an OS, within a virtual machine, on a physical machine, that's running another hundreds things like that more or less isolated from one another. While the application may be aware of what memory it's really using, the layers above may not be able to tell exactly what's used or sitting idle. It's a major challenge to estimate and distribute resources appropriately.