Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: How can I free the memory of a XML::Simple-Object

by bulk88 (Priest)
on Oct 27, 2012 at 03:17 UTC ( #1001153=note: print w/replies, xml ) Need Help??

in reply to How can I free the memory of a XML::Simple-Object

" eval 'no XML::Simple';" that probably did nothing. XML::Simple probably does not have or inherit an unimport sub. You can always ->import() ->unimport() any package and it will always "work", because of a special exception in the interp for those 2 method calls.
CProcess->PrintProcessInfo("perl.exe"); eval 'use XML::Simple'; CProcess->PrintProcessInfo("perl.exe"); { my $xs = new XML::Simple(); my $root= $xs->XMLin('D:\xTools\test\xmltest.xml'); CProcess->PrintProcessInfo("perl.exe"); undef $root; undef $xs; } CProcess->PrintProcessInfo("perl.exe");
Try that. Perl will always destroy at a scope boundary/change. Reassigning may or may not trigger a DESTROY (I don't exactly).

If you are desperate on memory you can try Symbol's delete_package and/or unloading XS modules (I'm not describing how to do that at the moment). Neither (delete_package/unloading an XS module) are guaranteed to free all memory. With a Perl that old, there are probably leaks that you can't fix without a newer version of Perl.

I also see "Threads 3", are you using ithreads? On a Perl that old they are alpha.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001153]
[erix]: that should be "to an already-too-late- project" I think
[ambrus]: oh yes, we have a pretty good example of that when they reorganized the grill place in the restaurant nearby.
[ambrus]: it now has two more people working there, and they're serving slower and more expensive.
[ambrus]: It used to be just a master cook who takes the order and puts the meat and eggs on the open grill plate table, and an assistant who removes them to a plate, adds the side dish, and gives the plate to the people in the queue, plus a cashier.
[ambrus]: Now it has five people instead of three, some sort of call number ticket system where people wait a lot for their food to get ready (it's the same kinds of grilled meat and fish on the same equipment, it won't actually fry slower),
[ambrus]: it's slow as hell, and the food costs significantly more.
[ambrus]: We no longer eat there.
LanX Everybody quotes it, some people read it, and a few people go by it
[ambrus]: LanX: why would I read it? isn't it a book for managers? I don't want to be a manager.
[ambrus]: I don't quote it either.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2017-09-22 13:51 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (264 votes). Check out past polls.