[TYPO3-mvc] ObjectStorage with large quantities of DB-Objects
Martin Kutschker
masi-no at spam-typo3.org
Wed May 26 10:30:16 CEST 2010
Nils Blattner schrieb:
> Am 25.05.10 08:46, schrieb Martin Kutschker:
>> Nils Blattner schrieb:
>>>
>>> I tried to remove the extbase references with
>>> $session->unregisterReconstitutedObject($user);
>>> where $session is the session of the persistence manager.
>>
>> Why didn't it work?
>>
>> Did you use PHP 5.3 with the garbage collection turned on or an ealier
>> version? Note that any
>> objects with cyclic references * will never be released fro memory by
>> PHP 5.2 and earlier.
>>
>> Masi
>>
>> *
>>
>> // case 1
>> parent->child = new Child()
>> child->parent = parent
>> unset(parent)
>> // memory for parent and child is still allocated!!!
>>
>> // case 2
>> parent->child = new Child()
>> child->parent = parent
>> unset(child->parent)
>> unset(parent)
>> // memory for parent and child is freed
>>
>
> PHP Version is 5.2.12 or something like that.
>
> However I was very thorough with removing my own references to the
> objects and can only assume they are still kept inside extbase in some
> form.
>
> I take it you refer to chunks of memory referencing between each other,
> but not connected to the root in any way when you say cyclic references.
I mean two objects referring to each other (as seen in my example from above).
> So they changed from reference counting to mark 'n sweep in 5.3?
I found an article in the Net that explained the new garbage collector of PHP 5.3. Of course I have
no idea of the URL any more (sorry). The only thing I remember is that the old system sucks and the
new one is sane :)
Masi
More information about the TYPO3-project-typo3v4mvc
mailing list