On Feb 8, 10:22 pm, William Stein <[email protected]> wrote:
> Yes it does.
Sorry for slandering the expect interface. I noticed that the expect
interface has a facility for reusing variables and that the maxima
expect interface doesn't use it. But you show that deletion does
happen, so no memorial benefit should be expected then.
> > It still uses the string-
> > based interface to bootstrap its translation dictionaries and for sage
> > types it doesn't have its own translation methods for, though, so some
> > memory is lost there.
>
> Lost or used? I.e., is this a memory leak or just that some memory is used.
Used in its world, but one could construct leaks this way. When one
has var("x") and, then the corresponding object in maxima is
xm=EclObject("%X"). The system creates dictionary entries {x : xm} and
{xm : x}. If one deletes x later on, the dictionary entries remain.
After all, there could still be a maxima object lingering somewhere
that can be converted to SR and hence recreate an instance x (i.e., x
still has a reference: via a maxima object).
Someone who knows how weakrefs work might be able to come up with a
solution that works by ignoring these via-maxima links.
The following would probably wreak havoc:
i=1
while true:
v=var("xx"+str(i))
integrate(cos(v),v)
delete xx+str(i) #whatever the appropriate clause is
i=i+1
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org