On Monday 29 May 2006 23:59, Simon Cross wrote:
> Hi Dan,
>
> On 5/29/06, Dan Pascu <[EMAIL PROTECTED]> wrote:
> > I've found that the problem lies in 2 circular references: one is the
> > instance attribute of sqlmeta which points back to the object and
> > the other is the soObject attribute of SQLObjectState which also
> > points back to the object.
>
> Python's optional garbage collector handles circular references just
> fine (at least this is the case for C Python).

That is true, but why should the application waste time collecting garbage 
on a constant basis when it can be avoided?

The garbage collector is there to protect you against common mistakes like 
these and to avoid memory to be leaked in such a case, but one shouldn't 
grow careless just because the garbage collector is there and does the 
job, because it does the job at a cost (extra CPU cycles)

>
> The problem is that
>
>  o = SomeSQLObjectClass(...)
>
> adds an new object to the database (in your case the in memory
> database so memory usage grows).

I think you misread my example. The test script I attached creates a 
database object and immediately destroys it with o.destroySelf() so the 
net result should be zero because the object is removed from both the 
database and the sqlobject cache when it's destroyed.

>
> That said, if you can remove the circular references without reducing
> functionality, I'm all for it. :)
>
> Schiavo
> Simon

-- 
Dan


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to