4 ms·
Would a malloc (alone) work? Doesn't it typically act as if the memory were allocated but not actually use physical RAM until the data is filled?
by singular 13y ago
Would a malloc (alone) work? Doesn't it typically act as if the memory were allocated but not actually use physical RAM until the data is filled?
- 0x0 13y agoI'm pretty sure that even if you malloc an enormous amount of memory, it will occupy close to no resources as long as the contents are not touched. Also related: "overcommit memory".
- e12e 13y agoLinux is a bit strange when it comes to memory allocation, see eg: http://www.win.tue.nl/~aeb/linux/lk/lk-9.html#ss9.6 http://www.win.tue.nl/~aeb/linux/lk/lk-9.html#ss9.6