【问题标题】:Measuring peak memory usage of Perl process with Valgrind使用 Valgrind 测量 Perl 进程的峰值内存使用量
【发布时间】:2011-03-06 07:03:40
【问题描述】:

我正在尝试使用 Valgrind 确定 Perl 脚本的峰值(堆)内存使用量:

valgrind --tool=massif --depth=1 /usr/bin/perl script.pl arguments

Valgrind 似乎启动得很好,脚本执行了,但没有生成massif.out.PID 文件。我已经成功地在 C 和 Lua 程序中使用了相同类型的命令,但由于某种原因,它似乎不适用于这个 Perl 脚本。

我使用的是 Mac OS 10.6.6,我的 Perl 是系统标准 v5.10.0 built for darwin-thread-multi-2level,我的 Valgrind 是 3.6.1(来自 MacPorts)。

【问题讨论】:

  • 嗯。似乎在 Ubuntu 9.04、相同的 Perl 版本和 Valgrind v3.4.1 上工作得很好。

标签: perl memory profiling valgrind


【解决方案1】:

您缺少 trace-children 选项。这个对我来说很好用

valgrind --tool=massif --depth=1 --trace-children=yes perl script.pl

【讨论】:

    猜你喜欢
    • 2012-12-02
    • 1970-01-01
    • 1970-01-01
    • 2010-10-20
    • 2012-03-29
    • 2016-05-15
    • 1970-01-01
    • 2016-05-07
    相关资源
    最近更新 更多