#4380: Memory Leak in libsingular
---------------------------------+------------------------------------------
 Reporter:  SimonKing            |       Owner:  malb                   
     Type:  defect               |      Status:  new                    
 Priority:  major                |   Milestone:  sage-3.2.1             
Component:  commutative algebra  |    Keywords:  memory leak libsingular
---------------------------------+------------------------------------------
 At http://groups.google.com/group/sage-
 support/browse_thread/thread/b997f95c1e2503e0/5db5f9e7d4c8faf2 was
 discussion about a memory leak. I found a reasonably short bit of code
 that triggers the leak.

 In `test.pyx`:
 {{{
 from sage.all import copy

 def Test(I):
     R=I.ring()
     p=R.random_element()
     J0=list(I.reduced_basis())
     while(1):
         J = copy(J0)
         for i in range(100):
             q=p.reduce(J)
             J.append(q)
 }}}

 Apparently the memory consumption should not grow, since `J` returns to
 its original state after finishing the `for` loop. However, the following
 `Sage` session is leaking (i.e., the memory consumption grows rapidly, and
 after a few seconds 1GB are filled up):
 {{{
 sage: attach test.pyx
 Compiling /home/king/Projekte/f5/test.pyx...
 sage: from sage.rings.ideal import Cyclic
 sage: R=PolynomialRing(QQ,'x',5)
 sage: I=Cyclic(R).homogenize()
 sage: Test(I)
 }}}

 The `while` loop comprises
  1. copying of a Sequence (`J0`) of `MPolynomial_libsingular`
  2. reduction of `MPolynomial_libsingular`
  3. appending to a Sequence.

 In one of these three steps must be the leak. I suspect it is the
 reduction and will try to verify it.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4380>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to