How to track memory consumption of a application #251
-
Hello, I want to monitor real time memory consumption of a running c++ application (in linux). I am able to do it using c++ api provided, but I want to know if I can monitor using command line utility? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments
-
do you want to monitor memory consumption or memory bandwidth consumption? PCM can only monitor memory bandwidth. Please also Q7: https://github.com/opcm/pcm/blob/master/FAQ.md |
Beta Was this translation helpful? Give feedback.
-
hey @opcm I want to monitor memory bandwidth consumption. |
Beta Was this translation helpful? Give feedback.
-
@opcm what I have tried,
my sample c++ code
|
Beta Was this translation helpful? Give feedback.
-
the memory allocation alone does not generate memory bandwidth. You need to read/write the memory. Also the array/accessed data needs to be larger than the CPU cache size to trigger memory bandwidth. Try 200 MB or larger arrays. |
Beta Was this translation helpful? Give feedback.
-
@opcm I tried to allocate 200 MB data ( I would like to point out some more info, this is what my internal of
I am running the exec |
Beta Was this translation helpful? Give feedback.
-
Your compiler might optimize it away, and just one time may not be enough to see a change.
Von meinem iPad gesendet
… Am 22.11.2020 um 20:10 schrieb suab321321 ***@***.***>:
@opcm I tried to allocate 200 MB data (10241024200) after this I tried to do memset and then free, even after doing I m not able to see any changes in ./pcm-memory.x.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
okay. Your CPU (Kabylake in the screenshot) is not supported by pcm-memory. Please see https://github.com/opcm/pcm/blob/master/FAQ.md#q6 How did you enforce pcm-memory to run? Did you modify pcm source code!? On your CPU you can monitor the read and write memory bandwidth in pcm.x (READ and WRITE metrics) |
Beta Was this translation helpful? Give feedback.
-
@opcm I did not modify anything it just ran on my system though I need to turn off nmi_watchdog and load the msr module, but I think these are to be done in supported cpu model too. I will try to run the test of intel xeon and see if it works there. Anyways thanks for clearing my doubt |
Beta Was this translation helpful? Give feedback.
-
this is definitely not pcm-memory code above. I am not sure where did you get it from... BTW: I have a Kabylake CPU too. pcm-memory.x does not work on it (as expected). |
Beta Was this translation helpful? Give feedback.
-
@opcm But this is what I have in my source code of pcm-memory.cpp |
Beta Was this translation helpful? Give feedback.
-
@opcm can we monitor a simple program using |
Beta Was this translation helpful? Give feedback.
-
the answers are in the FAQ recommended above.. |
Beta Was this translation helpful? Give feedback.
the answers are in the FAQ recommended above..