|Keep It Simple, Stupid|
Bless MyObjectby perlcapt (Pilgrim)
|on Oct 22, 2004 at 19:44 UTC||Need Help??|
perlcapt has asked for the
wisdom of the Perl Monks concerning the following question:
Without going into the details of my cruddy code, let me outline the situation and then state the problem.
The SituationI did a proof of concept, procedural hack that:
The main class is an data analyzer. The calling program, creates a new instansiation of this class, once, at the begining. After calling a method to open a data file, it then calls a method for giving it the next packet. The GetNextPacket method creates a new data object (using another class) for each data packet found. GetNexPacket returns the new object to the calling program, which typically keeps only a few of this packets around for data splicing.
The ProblemIt appears, because of deteriorating performance, that these data objects are not being clobbered when they are no longer referenced by the calling program. (In fact, in the testing program for the module, the returned value of GetNextPacket is simply assigned to a scalar that is overwritten on each call.)
The Question(s)How can I determined if these data objects are more persistant than I want? (I have looked at the process with both top (Linux) and Komodo (Dimdows), and nothing seems to be growing.) When should I create (bless) a new object, when not?