On Tue, 28 Oct 2003 10:18:44 -0800, Jeff Hobbs <[EMAIL PROTECTED]>
wrote:
>Ah ... variable unsetting now. Note you never did that before in the
>AOLServer version. This is key to release the refcounts that you have
>been adding up for the var. Also, as AOLServer pools, that var might
>not be getting cleaned up properly. In any case, you will end up with
>quite a lot of extra Tcl_Obj's allocated which remain around for the
>next use of that thread. They will release the mem of what they were
>containing (although the AOLServer threaded malloc may not), but the
>Tcl_Objs themselves are pooled by the Tcl core.
Thanks for the explanation.
Am I correct in thinking that AOLServer never releases TCL_Objs for the
lifetime of the thread ?
I can understand that this would be faster if the overhead on creating
them is higher than reusing ones in an exiting pool.
Your explaination also makes sense of the following script which also
causes memory usage to soar;
for {set i 0} {$i<100000} {incr i} {
set temp$i [list one two three four five six seven eight nine]
}
>In any case, this wholly bogus example does highlight some of the mem
>characteristics of the core/AOLServer, but there are many ways to control
>real bloat. Perhaps if you should some more real code we could assist in
>pointing out what may be awry.
>
I use lists of lists as a data stucture. I can reduce memory usage by
using a cursor to fetch records from the database but sometimes it is
useful to cache or serialize the data so that I can seperate data from
presentation or provide a database abstraction layer.
I had a look at trying to create data structures using a list of ns_set
references and a list of array references but a list of lists turned out
to be the fastest.
Thanks for your help
Bernhard
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of
your email blank.