The Linux kernel memory maps executables and shared libraries (via the same method as mmap()'d files), and it only loads parts into memory as they're needed for execution. This also makes freeing memory easier because the VM can just free the pages used by the binary, because they'll be reread into memory if they're needed again, no need to swap them out.