in reply to Re: Massive Perl Memory Leak
in thread Massive Perl Memory Leak
I have a previous version of the script that doesn't have the memory leak. The only real difference is the use of a central datahash to keep everything. The old script just directly prints everything. That's why I think this is the culprit.
I wrote a test script that used Padwalker to check on the my'd variables with peek_my and then Data::Dump that hash. That showed something very interesting. After I assigned the independent hashes into the datahash (%{$datahash{"branch"}} = %branchdata;) the dump showed both hashes were refering to the same data. It wasn't a pure copy. Like:
do { my $a = { "%cdp" => { "1.4" => { id => "switch", ip => "1.2.3.4", platform => "WS-C6509", } }, "%datahash" => { cdp => { "1.4" => 'fix', "1.5" => 'fix' }, }, }; $a->{"%datahash"}{cdp}{"1.4"} = $a->{"%cdp"}{"1.4"}; };
Does this shed any light on anything? Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Massive Perl Memory Leak
by BrowserUk (Patriarch) on Jun 12, 2007 at 20:03 UTC | |
by wagnerc (Sexton) on Jun 12, 2007 at 21:16 UTC | |
by chromatic (Archbishop) on Jun 12, 2007 at 21:50 UTC | |
by wagnerc (Sexton) on Jun 12, 2007 at 22:06 UTC | |
by BrowserUk (Patriarch) on Jun 12, 2007 at 22:44 UTC | |
| |
by chromatic (Archbishop) on Jun 12, 2007 at 22:43 UTC | |
|
Re^3: Massive Perl Memory Leak
by ysth (Canon) on Jun 12, 2007 at 22:25 UTC |