Malloc allocates memory more than RAM

后端 未结 4 476
执念已碎
执念已碎 2020-12-29 15:44

I just executed a program that mallocs 13 MB in a 12 MB machine (QEMU Emulated!) . Not just that, i even browsed through the memory and filled junk in it...



        
4条回答
  •  忘掉有多难
    2020-12-29 16:09

    It's called virtual memory which is allocated for your program. It's not real memory which you call RAM.

    There is a max limit for virtual memory as well, but it's higher than RAM. It's implemented (and defined) by your operating system.

提交回复
热议问题