News for hackers. Stuff that matters.
Re:Everything old is new again: memory optimization by Twirrim on Friday March 27, 2026 @10:50AM (#47543321)
A lot of programs over-allocate on virtual memory, but don't actually use it, and the OS is smart enough to just pretend like it allocated it. I'm sure there's probably some justification for it somewhere, but it's hard not to see it as some absurd organically achieved agreement. Developers used to ask for more memory than their application actually needed and caused all sorts of OOM problems for end users. OS developers realised this and made the OS lie to the app to tell it it got what it asked for, and only give it memory as needed. Now developers just can't be bothered to set any realistic amount of memory, because what's the point, the OS is going to ignore it anyway.

Electron really loves to claim absurd amounts of memory, e.g. slack has claimed just over 1TB of virtual memory, but is only using just north of 200MB.

Re:Everything old is new again: memory optimization by astrange on Saturday March 28, 2026 @04:01PM (#47557722)
There is literally no reason to care how much "virtual memory" you're using - pointers are 64-bit after all.

(Well, 48 bits.)

Exceptions apply on Windows for reasons I forget, and on watchOS because there isn't enough memory for the page tables for really big VM regions.