我怎么能检查多少内存在内存中分配给我的C程序,当我运行我的程序 [英] how can I check how much memory is allocated for my C program in memory when I run my program

查看:164
本文介绍了我怎么能检查多少内存在内存中分配给我的C程序,当我运行我的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我要检查多少内存分配内存我的C程序的时候我跑因为我想减少我的程序的大小,如果我得到了多少内存使用我的程序,以便那么它帮助我减小尺寸。
所以任何可以告诉我怎么可以在C这样做吗?

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 ?

推荐答案

在Windows上:

右键单击任务栏(的Windows 7 / Windows 8中)及 CTRL + ALT + DEL 在Windows XP中,单击开始任务Mananger 。一个窗口会弹出,转到性能标签,然后点击资源箴言报按钮。新的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.

在Linux上:

获取进程的PID,然后键入顶-p PID 。将显示有关的处理的信息,包括所使用的系统存储器的百分比。

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

这篇关于我怎么能检查多少内存在内存中分配给我的C程序,当我运行我的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆