Hacker News new | ask | show | jobs
by adastra22 245 days ago
RAM is not cheap. Executables live in RAM when running.
3 comments

Executables lives in pages of RAM and not all pages are in physical memory at once.
No, they're mmapped to RAM. Only the pages that get used are loaded to RAM.
Absent evidence to the contrary, the reasonable assumption here is that all of those pages are being used. The rest compiler is not in the habit of generating volumes of code that aren’t being called.
That would be asking to prove a negative, which isn't reasonable.

Also, the question isn't if the code isn't used, it is that it isn't used simultaneously. Almost all software has many features which aren't used simultaneously. For example, it is unlikely you have all of the different language parsers loaded at the same time, because most projects use only a few.

Only the parts that are being used (the working set).