Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Memory leaks and circular references

by Animator (Hermit)
on Sep 07, 2008 at 18:56 UTC ( [id://709674]=note: print w/replies, xml ) Need Help??


in reply to Memory leaks and circular references

This is leaking since Change 26530.

http://public.activestate.com/cgi-bin/perlbrowse/p/26530:

Change 26530 by nicholas@nicholas-saigo on 2005/12/30 01:08:46

	RMAGIC on symbol tables is bad, m'kay.
	Allow hashes (and therefore all symbol tables) to store the
	backreference array in the hv_aux structure, and thereby undo the
	performance damage of 24966, which resulted in 60% of all hash lookups
	trying to mg_find tiehash magic.

One instance of this in the RT queue of perl: #56908: DBI memory leak

Dave Mitchell commited a change for this: http://public.activestate.com/cgi-bin/perlbrowse/p/34209:

Change 34209 by davem@davem-pigeon on 2008/08/20 23:15:36

	perl #56908 DBI memory leak in 5.10.0 due to change 26530
	
	A weakref to a HV would leak, because the xhv_backreferences
	array is created with a refcount of 2 (to avoid premature freeing
	during global destruction), but the RC was only decremented once
	when the parent HV was freed.
	Also, when thread cloned, the new array was being created with a
	RC of 1, rather than 2, which coincidentally worked due to the
	first bug.

but testing this change and trying to wrap it in a good test case is still on my todo list.

(Running it with a blead after Change 34209 shows no leak)

  • Comment on Re: Memory leaks and circular references

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://709674]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-23 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found