代码之家  ›  专栏  ›  技术社区  ›  code_fodder

valgrind massif heap profiler没有详细的快照视图-如何放大/缩小?

  •  0
  • code_fodder  · 技术社区  · 7 年前

    因此,我试图在Ubuntu 18中看到我的C++程序的堆内存使用情况。

    我用以下方法运行它:

    valgrind --tool=massif --smc-check=all ./myprogram

    我得到相当大的产量,这是可以的。我使用Massif可视化工具查看它。

    我得到了一张漂亮的图表。但我想在我的程序结束时详细看看它关闭得有多好。但我似乎无法放大图表视图,我看不到执行此操作的选项。

    MangPin( here 这样说:

    massif生成一些基本上构成 树。如果你想要 要以比简单树视图更舒适的方式获得概述,请切换到 详细的快照选项卡,并将树可视化为调用图。放大,缩小,使用 鸟瞰图,看看是什么促成了给定的快照。注意函数调用 使用相同的内存成本进行分组,以便轻松找到感兴趣的部分。

    但我看不出 switch over to the detailed snapshot tab “……”还有人知道怎么做吗?

    Ubuntu 18

    Massif可视化工具0.7

    1 回复  |  直到 7 年前
        1
  •  1
  •   phd    7 年前

      user options for Valgrind tools that replace malloc:
        --alignment=<number>      set minimum alignment of heap allocations [16]
        --redzone-size=<number>   set minimum size of redzones added before/after
                                  heap blocks (in bytes). [16]
        --xtree-memory=none|allocs|full   profile heap memory in an xtree [none]
                                  and produces a report at the end of the execution
                                  none: no profiling, allocs: current allocated
                                  size/blocks, full: profile current and cumulative
                                  allocated size/blocks and freed size/blocks.
        --xtree-memory-file=<file>   xtree memory report file [xtmemory.kcg.%p]
    

    http://www.valgrind.org/docs/manual/manual-core.html#manual-core.xtree

    推荐文章