Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [propel-dev] propel 1.2

propel
Discussion topic

Back to topic list

Re: [propel-dev] propel 1.2

Reply

Author Alan Pinstein <apinstein at mac dot com>
Full name Alan Pinstein <apinstein at mac dot com>
Date 2005-12-06 08:43:38 PST
Message Ugh. I found the leak... I think it's a bit tricky....

So, I have an MlsProperty which has 0-N MlsPropertyFeatures.

Here's a little debug output from a script that imports 10
properties. All but one have 1+ MlsPropertyFeatures...

Importing: ./savedData.txt
new MlsProperty
new MlsPropertyFeature
Adding MlsPropertyFeature to MlsProperty
new MlsProperty
new MlsPropertyFeature
Adding MlsPropertyFeature to MlsProperty
new MlsProperty
new MlsPropertyFeature
Adding MlsPropertyFeature to MlsProperty
new MlsProperty
destroy MlsProperty **** this is the only one to get destroyed
properly, and it's the only one that has 0 MlsPropertyFeature's
new MlsProperty
new MlsPropertyFeature
Adding MlsPropertyFeature to MlsProperty
new MlsProperty
new MlsPropertyFeature
Adding MlsPropertyFeature to MlsProperty
new MlsProperty
new MlsPropertyFeature
Adding MlsPropertyFeature to MlsProperty
new MlsProperty
new MlsPropertyFeature
Adding MlsPropertyFeature to MlsProperty
new MlsProperty
destroy MlsProperty
new MlsProperty
destroy MlsProperty
Done processing './savedData.txt'
====================​========> Leaked: 4039.2
[script ends, php cleanup follows]
destroy MlsProperty
destroy MlsPropertyFeature
destroy MlsProperty
destroy MlsPropertyFeature
destroy MlsProperty
destroy MlsPropertyFeature
destroy MlsProperty
destroy MlsPropertyFeature
destroy MlsProperty
destroy MlsPropertyFeature
destroy MlsProperty
destroy MlsPropertyFeature
destroy MlsProperty
destroy MlsPropertyFeature

====================​====================​====

So, the problem is:

     // in BaseMlsProperty.php
     public function addMlsPropertyFeatur​e(MlsPropertyFeature​ $l)
     {
         print "Adding MlsPropertyFeature to MlsProperty\n";
         $this->collMlsPr​opertyFeatures[] = $l;
         $l->setMlsProperty($this);
     }

     // in BaseMlsPropertyFeature.php
     public function setMlsProperty($v)
     {


         if ($v === null) {
             $this->setMlsPro​pertyId(NULL);
         } else {
             $this->setMlsPro​pertyId($v->getM​lsPropertyId());
         }


         $this->aMlsProperty = $v;
     }

A circular reference is being created... since PHP doesn't have weak
references I am not sure how to fix this... off the top of my head I
don't see how this circular reference can be eliminated without
losing functionality.

There seems to be a lot of talk on php lists about the circular
reference problem. The php-dev guys seem to think it's not a bug,
which I suppose "technically" it isn't since the memory is freed, but
it is then certainly a language deficit for doing big OO projects.

Thoughts?

Alan

On Dec 6, 2005, at 8:49 AM, Hans Lellelid wrote:

> Yes -- Creole (CVS) will coincide w/ Propel release. Thanks for
> looking
> into the leaking, Alan!

« Previous message in topic | 10 of 20 | Next message in topic »

Messages

Show all messages in topic

Re: [propel-dev] propel 1.2 hlellelid Hans Lellelid 2005-11-22 18:37:02 PST
     Re: [propel-dev] propel 1.2 Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-05 22:39:22 PST
         Re: [propel-dev] propel 1.2 hlellelid Hans Lellelid 2005-12-06 05:49:29 PST
             Re: [propel-dev] propel 1.2 Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-06 07:52:58 PST
                 Re: [propel-dev] propel 1.2 Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2005-12-06 08:21:37 PST
                     Re: [propel-dev] propel 1.2 Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2005-12-06 08:29:27 PST
                         Re: [propel-dev] propel 1.2 Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-06 08:31:38 PST
                             Re: [propel-dev] propel 1.2 Ron Rademaker <r dot rademaker at virtualbuilding dot nl> Ron Rademaker <r dot rademaker at virtualbuilding dot nl> 2005-12-06 08:34:44 PST
                                 Re: [propel-dev] propel 1.2 Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-06 08:36:37 PST
             Re: [propel-dev] propel 1.2 Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-06 08:43:38 PST
                 Re: [propel-dev] propel 1.2 Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-06 09:19:49 PST
                     Re: [propel-dev] propel 1.2 Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-06 12:20:45 PST
                         Re: [propel-dev] propel 1.2, Memory Leak Quashed! Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-06 17:16:27 PST
                             RE: [propel-dev] propel 1.2, Memory Leak Quashed! =?US-ASCII?Q?Sonke_Ruempler?= <ruempler at topconcepts dot com> =?US-ASCII?Q?Sonke_Ruempler?= <ruempler at topconcepts dot com> 2005-12-06 23:27:14 PST
                                 Re: [propel-dev] propel 1.2, Memory Leak Quashed! Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-07 06:19:03 PST
                                     Re: [propel-dev] propel 1.2, Memory Leak Quashed! hlellelid Hans Lellelid 2005-12-07 06:41:07 PST
                                         Re: [propel-dev] propel 1.2, Memory Leak Quashed! Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-07 06:49:31 PST
                                         Re: [propel-dev] propel 1.2, Memory Leak Quashed! =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2005-12-07 07:19:53 PST
                                             Re: [propel-dev] propel 1.2, Memory Leak Quashed! Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2005-12-07 07:31:58 PST
                                                 Re: [propel-dev] propel 1.2, Memory Leak Quashed! =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2005-12-07 08:02:51 PST
Messages per page: