|
|
|
|
|
by roblabla
1949 days ago
|
|
You absolutely can allocate memory without using up any backing resources. On Linux (which is where I have experience, but I assume macos works similarly), even after mapping some memory, it won't be backed by any physical memory (e.g. RAM) until you actually write there. And you can mmap files into your address space, meaning you can place a huge file you can access through memory, but it's not actually taking any RAM, the kernel is just doing the reading of each "chunk" of the file as you access them, unloading the old bits once you stop using them for a while. Measuring memory usage is hard. |
|