how can I check how much memory is allocated for m

2020-05-10 04:35发布

hey I want to check that how much memory is allocated for my C program in memory when i run because I want to reduce the size of my program if I get that how much memory used my program so then its help to me to reduce the size. so any can tell me how can I do this in C ?

标签: c memory
1条回答
Explosion°爆炸
2楼-- · 2020-05-10 05:07

On Windows:

Right click on the TaskBar (Windows 7/ Windows 8) & CTRL+ALT+DEL on Windows XP, click Start Task Mananger. A windows will popup, go to Performance tab and click on Resource Moniter button. A new windows will pop up. Find your process there in the list of Memory section.

On Linux:

Get pid of the process and type top -p PID. It will display information about the process, including percent of system memory used.

查看更多
登录 后发表回答