Comment 29 for bug 24692

Revision history for this message
ruediix@gmail.com (ruedii) wrote :

Simon Ruggier is correct. Virtual addressing has nothing to do with physical address space used.

This "empty" space doesn't even take up swap space, let alone virtual memory. It does take up some page tables but that's it.

Having the extra virtual address space there is actually a good thing. It reduces vulnerability to buffer overflows, and similar issues.

However, I must agree that 1MB is a bit big, especially for libraries that are only a few kilobytes. Generally 4KB-64KB of space is enough to prevent issues. However, considering the Linux Userland virtual address space on AMD64 is currently 128TB, I don't think there is any shortage of virtual address space in the near future.

There may be other reasons for providing this extra space that I don't know about. Some of these libraries might allocate additional memory for certain things, and this would provide plenty of space for them to do so while keeping the same block of memory.