Without going into the details of my cruddy code, let me outline the situation and then state the problem.
The Situation
I did a proof of concept, procedural hack that:
- reads chunks of data in from a binary file using sysread
- finds the overal structural separators that define data packets
- determines what kind of data packet it is
- further analyses the packet, breaking it into its separate channels
Now the project becomes real, requiring more sophistication, I take the "proof of concept" procedural hack and develop it into a perl module.
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 Problem
It 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?
Gracias