如何访问 Perl 哈希的引用计数? [英] How can I access the ref count of a Perl hash?

查看:50
本文介绍了如何访问 Perl 哈希的引用计数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我的脚本的垃圾收集器做得更好.它应该能够回收大量内存,但有些东西阻止了它.

I'm trying to enable the garbage collector of my script to do a better job. There's a ton of memory that it should be able to reclaim, but something is stopping it.

我使用过Devel::Cycle,这让我能够靠近一点,但我还没到.

I've used Devel::Cycle a bit and that's allowed me to get closer but I'm not quite there.

如何找出 Perl 哈希(我的对象的存储)的当前引用计数?

How do I find out the current reference count for a Perl hash (the storage for my objects)?

有没有办法跟踪谁持有对象的引用?也许是一种领带说,每当有人指出这个对象时,记住那个人是谁.

Is there a way to track who is holding a reference to an object? Perhaps a sort of Tie that says, whenever someone points are this object, remember who that someone is.

推荐答案

您正在寻找 Devel::引用计数.

这篇关于如何访问 Perl 哈希的引用计数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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