How to see the memory occupied by initialised array vs uninitialised array

空扰寡人 提交于 2019-12-01 21:33:51

I want to see the memory footprint of each version of the code after the program is compiled…

The difference is in the size of the compiled executable, not the size of its image in memory when it's being executed.

In brief: most modern operating systems have a way for an executable to declare a memory region as "zero filled". The executable only needs to say how big the region is, so it's much smaller than if it included a bunch of literal zeroes for that region.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!