[Xotcl] memory leak problem

Gustaf Neumann neumann at wu.ac.at
Fri Oct 23 14:44:35 CEST 2009


Dear Victor and all

A small update:
  - the problem has nothing to do with 64 bit
  - the problem has nothing to do parametercmd, but with
     namespaced variables (even worse)
  - the problem does not show up, when both xotcl and tcl are compiled
    against tcl 8.4.* or tcl 8.5.*
  - the problem shows only up, when xotcl is compiled against tcl 8.4 and
    loaded into a tclsh compiled with tcl 8.5
  - the problem is related to varReform, tcl refuses to delete the variables
    when TclDeleteVars() is called. It is not a tcl bug, but most likely
    related with the "forward-compatible" mode of xotcl (tcl 8.5
    variables are quite different to 8.4, but at the time xotcl is compiled
    against tcl 8.4, it does not know anything about the new variable
    structures/semantics; it tries hard to behave correctly, but obviouly,
    not hard enough).

normally, i would be inclined to say "please take a matching version"
(use xotcl compiled for 8.5 with a tclsh compiled with 8.5, etc),
but since it is getting more and more likely, that xotcl 2.0 will require
tcl 8.5 or newer, i'll try to look into the problem further, probably over
the weekend

all the best
-gustaf neumann

Gustaf Neumann schrieb:
> Hmm,
>
> a quick test shows that it runs in constant memory (1.8 MB) with xotcl 
> 1.6.3 and
> xotcl 1.6.4 under Mac OS X Leopard with Tcl 8.5.7. i just modified the 
> script
> slightly to make it a complete script (see below).
>
> will check tomorrow on more platforms.
>
> -gustaf neumann
>
>
> ==========================
> set i 0
> time {lappend ::parameter_list parameter[incr i]} 100
>
> Class X
> X instproc init args {
>   my requireNamespace; ### I need that
>   foreach p [set ::parameter_list] {
>     my parametercmd $p
>     my $p {}
>   }
>   next
> }
>
> time {X x; x destroy} 1000000
> ==========================
>
> Victor Mayevski schrieb:
>   
>> Hello,
>>
>> I am using XOTcl 1.6.3, on 64bit Linux platform, with ActiveState
>> 8.6.b2 distribution. The distribution itself is 32bit. I also tried
>> and have the same problem with 32bit ActiveState 8.5.7 version.
>>
>> The simplest way to reproduce the problem is to do the following:
>>
>> Class X;
>>
>> set parameter_list {parameter1 parameter2 .... parameter100}; ### 100
>> or so values
>>
>> X instproc init args {
>>    my requireNamespace; ### I need that
>> foreach p [set ::parameter_list] {
>>    my parametercmd $p;
>>    my $p {};
>> };
>> next;
>> };
>>
>> #then run the following
>>
>> time {X x; x destroy} 1000000
>>
>>
>> ### the above line eats up a lot of memory and it is not being
>> released during destruction of an instance.
>>
>>
>> Thanks.
>> _______________________________________________
>> Xotcl mailing list
>> Xotcl at alice.wu-wien.ac.at
>> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
>>   
>>     
>
> _______________________________________________
> Xotcl mailing list
> Xotcl at alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
>   



More information about the Xotcl mailing list