How to profile memory usage of a C program

前端 未结 4 441
鱼传尺愫
鱼传尺愫 2021-01-02 17:13

I need to figure out which part of a linux program that I am running, is taking how much (either percentage, or absolute) memory. I need to create a profile of multiple such

4条回答
  •  盖世英雄少女心
    2021-01-02 17:48

    Memory consumption should not be massively affected by the underlying processor architecture so you might be able to do the memory profiling on x86 Linux. Yes, the absolute amounts of memory probably are a affected but as you're looking more for relative than absolute numbers, this should work.

    That said, this solution is unlikely to be an option if a Linux x86 build is more than a recompile away.

提交回复
热议问题