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

为什么我的程序会从一个我不使用的框架中泄漏分配给我不使用的对象的内存?

  •  3
  • mipadi  · 技术社区  · 14 年前

    我跑了一辆 leaks 报告我正在开发的项目,结果如下:

    Process 2454: 155054 nodes malloced for 7464 KB
    Process 2454: 6 leaks for 608 total leaked bytes.
    Leak: 0x14984360  size=160  zone: DefaultMallocZone_0x127000    instance of 'SecCertificate', type CFType, implemented in Security  
        0xa024562c 0x01015580 0x00000000 0xa0575c68     ,V$..U......h\W.
        0x00000000 0x00000000 0x00000000 0x00000000     ................
        0x0046d8cc 0x1492a480 0x00000000 0x4d555458     ..F.........XTUM
        0x00000000 0x00000068 0x00000000 0x00000000     ....h...........
        0x00000000 0x00000000 0x00000000 0x00000000     ................
        0x00000000 0x00000000 0x00000000 0x00000000     ................
        0x00000000 0x00000000 0x00000000 0x00000000     ................
        0x00000000 0x00000000 0x00000000 0x00000000     ................
        ...
    Leak: 0x1447cab0  size=144  zone: DefaultMallocZone_0x127000    string 'Ä'
    Leak: 0x146b4010  size=96  zone: DefaultMallocZone_0x127000 instance of 'SecKeychainItem', type CFType, implemented in Security 
        0xa024562c 0x01015980 0x00000000 0xa0575de8     ,V$..Y.......]W.
        0x00000000 0x00000000 0x00000000 0x00000000     ................
        0x0046d8cc 0x1481dbb0 0x00000000 0x4d555458     ..F.........XTUM
        0x00000000 0x00000068 0x00000000 0x00000000     ....h...........
        0x00000000 0x00000000 0x00000000 0x00000000     ................
        0x00000000 0x00000000 0x00000000 0x00000000     ................
    Leak: 0x147ecf70  size=80  zone: DefaultMallocZone_0x127000 string 'Ä'
    Leak: 0x1481dbb0  size=64  zone: DefaultMallocZone_0x127000 string 'O'
    Leak: 0x1492a480  size=64  zone: DefaultMallocZone_0x127000 string 'ê'
    

    SecCertificate SecKeychainItem

    1 回复  |  直到 14 年前
        1
  •  0
  •   bbum    14 年前

    可能是假阳性。如果只泄漏了608字节,不用担心。

    请随时通过 http://bugreport.apple.com/ 不过。