#16809: leak in maxima interface
-------------------------------------+-------------------------------------
       Reporter:  nbruin             |        Owner:
           Type:  defect             |       Status:  new
       Priority:  major              |    Milestone:
      Component:  interfaces         |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/nbruin/ticket/16809              |  22f3b7359a9f7783281749479ffbd89e4191d86c
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by nbruin):

 The current branch solves the problem by augmenting the "variable clear"
 function with an "unintern" of the corresponding lisp symbol. It seems to
 work OK, but I'm not 100% sure whether it's safe to do so. If one ends up
 deleting a symbol that is used elsewhere in expressions, then uninterning
 the symbol could lead to very funny situations: the next time the symbol
 gets created from a string, a new (interned) symbol would be created,
 leading to two distinct symbols with identical print names.
 {{{
 from sage.libs.ecl import ecl_eval
 def ecl_symbols():
     return set(ecl_eval("""(let ((lst ())) (do-all-symbols (s lst) (push s
 lst)) lst)"""))
 A = ecl_symbols()
 while True:
    _= sin(x).simplify()
    B = ecl_symbols()
    print B.difference(A)
    A= B
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16809#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to