Thanks Oleg,

hmm, it seems that an object inherites SQLObject is not freed, but a
plain object is freed.
The following code explains.

class DBObject(SQLObject):
    name = StringCol()

class NormalObject:
    name = ""

obj_list = []
for i in xrange( 100000 ):
    obj = DBObject( name = "foo" )
    obj.expire()
    obj_list.append( obj )
del obj_list[:] # memory usage is kept

for i in xrange( 100000 ):
    obj = NormalObject
    obj.name = "foo"
    obj_list.append( obj )
del obj_list[:] # memory usage is EXACTLY freed from OS, by looking
top(1) screen.

The difference of the above two code is the class of the object in the obj_list.
(DBObject is freed from cache by calling .expire())

And, memory is freed in the following code.

for i in xrange( 1000 ):
    obj = DBObject( name = "foo" )
    obj.expire()

Each time obj is created, its cache is cleared and memory is freed
from OS as expected.

Thus, the difference is that the object is stored in obj_list or not,
and the object is an SQLObject or not.
But I cannot understand why these differences cause the different memory usage.


2006/9/14, Oleg Broytmann <[EMAIL PROTECTED]>:
> On Wed, Sep 13, 2006 at 11:29:39PM +0900, ?$B6L1[ ?$BBg51 wrote:
> > 3. When I delete the object, the occupied memory is freed.
>
>    The memory is freed for Python, by Python doesn't return the memory to
> OS. So even after connection.cache.clear() the memory usage by the process
> remains the same.
>
> Oleg.
> --
>      Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
>            Programmers don't die, they just GOSUB without RETURN.
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> sqlobject-discuss mailing list
> sqlobject-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>


-- 
株式会社ビービット 玉越 大輝
ユーザビリティ コンサルタント
beBit,Inc. Tamakoshi Hiroki [EMAIL PROTECTED]
--------------------------------------------------------
〒105-0001 東京都港区虎ノ門1-18-1 虎ノ門10森ビル7F
TEL: 03-3509-7602 / FAX: 03-3509-7605
URL: http://www.bebit.co.jp/
--------------------------------------------------------

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to