in reply to Re^2: Object::InsideOut leaks memory when using threads::shared
in thread Object::InsideOut leaks memory when using threads::shared
Or can someone at lest try to run this code and say whether it leaks on his/her machine? I would be very gratefull.
I confirm that your test code leaks at a rate of about 1.5MB/s here (I've printed out the versions I have):
#! perl -slw { package Test; use Object::InsideOut; my @dummy :Field; } package main; use threads; use threads::shared; print $]; print $threads::VERSION; print $threads::shared::VERSION; print $Object::InsideOut::VERSION; while (1) { my $o = new Test; } __END__ c:\test>junk66 5.010001 1.76 1.33 3.69
You'll see I've tried swapping things around a bit to see if it made any difference (having read the following in the O::IO docs:
If you receive an error similar to this: ERROR: Attempt to DESTROY object ID 1 of class Foo twicethe cause may be that some module used by your application is doing require threads somewhere in the background. DBI is one such module. The workaround is to add use threads; at the start of your application.
The only thing that prevented the leak was to comment out use threads::shared as you've already discovered.
I took a (brief) look inside, but that requires a PhD in O'Woe, and I failed my masters in that subject :)
|
|---|