Are some allocators lazy?

后端 未结 6 1578
遇见更好的自我
遇见更好的自我 2020-11-27 21:34

I wrote a C program in Linux that mallocs memory, ran it in a loop, and TOP didn\'t show any memory consumption.

then I\'ve done something with that memory, and TOP

6条回答
  •  一个人的身影
    2020-11-27 22:22

    Are you using compiler optimizations? Maybe the optimizer has removed the allocation since you're not using the allocated resources?

提交回复
热议问题