3 ms·
Nitpick: it requires using 4 GB of address space, not necessarily physical memory - the app might be eg memory mapping the file. (mmap() can be reasonably used
by fulafel 4y ago
Nitpick: it requires using 4 GB of address space, not necessarily physical memory - the app might be eg memory mapping the file.
(mmap() can be reasonably used for streaming usecases like this provided you use madvise() hints on whether you want the data kept resident after use, probably non unix platforms have similar apis)
- csande17 4y agoRight, mmap() lets you get a big buffer without actually using that much physical memory. Good catch! I still think it's unlikely for an app to be vulnerable to this but having less than 4 GB of RAM isn't an absolute defense. Having a 32-bit address space probably is, though, if you're running on old or embedded hardware.