我如何解释 Devel::Leak 的输出 [英] How do I interpret the output of Devel::Leak

查看:56
本文介绍了我如何解释 Devel::Leak 的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行了 Devel::泄漏在我的程序中,我不明白它给我的输出.

I've run Devel::Leak in my program and I don't understand the output it's giving me.

首先,我看到它正在打印一个指针列表.我可以在数组中获取该列表吗?然后我可以使用 FindRef 查看它的来源.

To start, I see it's printing a list of pointers. Can I get that list in an array? Then I can use FindRef to see where it's coming from.

例如:

new 0xaebc28 : SV = PVGV(0x30e7e48) at 0xaebc28
  REFCNT = 1
  FLAGS = (GMG,SMG)
  IV = 0
  NV = 0
  PV = 0
  MAGIC = 0x2db7dc0
    MG_VIRTUAL = &PL_vtbl_glob
    MG_TYPE = PERL_MAGIC_glob(*)
    MG_OBJ = 0xaebc28
  NAME = "SUPER::"
  NAMELEN = 7
  GvSTASH = 0x76b228    "IO::File"
  GP = 0x314b170
    SV = 0x30283c8
    REFCNT = 1
    IO = 0x0
    FORM = 0x0  
    AV = 0x0
    HV = 0x301fdb8
    CV = 0x0
    CVGEN = 0x0
    GPFLAGS = 0x0
    LINE = 161
    FILE = "/mypath/perl_install/perl/lib/5.8.9/x86_64-linux/IO/File.pm"
    FLAGS = 0x0
    EGV = 0xaebc28      "SUPER::"

或一堆较小的条目:

new 0x161c268 : SV = RV(0x3029b40) at 0x161c268
  REFCNT = 1
  FLAGS = (ROK)
  RV = 0x161c218

我该怎么办?我得到了 Perl 结构的东西(magic、iv、pv...),但是我如何从这些行开始知道我的泄漏发生在哪里?

What do I do with this? I get the Perl struct stuff (magic, iv, pv,..), but how do I go from these lines to knowing where my leak is occurring?

推荐答案

看一看 Devel::LeakTrace 用于记录内存分配位置的模块.

Take a look at Devel::LeakTrace for a module which also records where memory has been allocated.

这篇关于我如何解释 Devel::Leak 的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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