Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#562 closed defect (duplicate)

memleak in Matrix_integer_dense__zero_out_matrix exposed by ModularSymbols(n,sign=1).decomposition()

Reported by: mabshoff Owned by: mabshoff
Priority: major Milestone: sage-2.8.5
Component: memleak Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Hello folks,

for n in range(10,100): a=ModularSymbols(n,sign=1).decomposition(); print n, get_memory_usage()

causes (among other things) the following:

==5107== 133,912 bytes in 16,739 blocks are definitely lost in loss record 2,832 of 2,944
==5107==    at 0x4A05809: malloc (vg_replace_malloc.c:149)
==5107==    by 0x94A2697: __gmpz_init (in /tmp/Work2/sage-2.8.3.rc3/local/lib/libgmp.so.3.4.1)
==5107==    by 0x203F822F: __pyx_f_20matrix_integer_dense_20Matrix_integer_dense__zero_out_matrix (matrix_integer_dense.c:46
35)
==5107==    by 0x20426114: __pyx_f_20matrix_integer_dense_20Matrix_integer_dense___init__ (matrix_integer_dense.c:3755)
==5107==    by 0x45A321: type_call (typeobject.c:436)
==5107==    by 0x4156A2: PyObject_Call (abstract.c:1860)
==5107==    by 0x480783: PyEval_EvalFrameEx (ceval.c:3775)
==5107==    by 0x4865EF: PyEval_EvalCodeEx (ceval.c:2831)
==5107==    by 0x4845B3: PyEval_EvalFrameEx (ceval.c:3660)
==5107==    by 0x4865EF: PyEval_EvalCodeEx (ceval.c:2831)
==5107==    by 0x4CFED0: function_call (funcobject.c:517)
==5107==    by 0x4156A2: PyObject_Call (abstract.c:1860)

Cheers,

Tagged for 2.8.4

Michael

Change History (6)

comment:1 Changed 14 years ago by mabshoff

  • Status changed from new to assigned

comment:2 Changed 14 years ago by mabshoff

Mmmh, it looks like a matrix over ZZ isn't properly deallocated in Sage's python code. I looked at all the path and the deallocation seems to work correctly. William did mention something about this in IRC a couple days ago.

Cheers,

Michael

comment:3 Changed 14 years ago by mabshoff

I have to correct myself. Doing a

sage: for I in range(1000):
....:     a = Matrix(ZZ,2,[1,2,3,4])
....:     del a

vs.

sage: for I in range(1000):
....:     a = Matrix(ZZ,2,[1,2,3,4])

leads to identical numbers when valgrinding. My guess is that the leak must be somewhere in the Cython code when initializing a matrix filled with zeros without deallocating it.

Cheers,

Michael

comment:4 Changed 14 years ago by was

  • Milestone changed from sage-2.8.4 to sage-2.9

comment:5 Changed 14 years ago by mabshoff

  • Resolution set to duplicate
  • Status changed from assigned to closed

Am am an idiot, because I just opened a duplicate of the same problem at #619. Since the descrition is better over there I am closing this one as duplicate.

Cheers,

Michael

comment:6 Changed 14 years ago by mabshoff

  • Milestone changed from sage-2.9 to sage-2.8.4.3
Note: See TracTickets for help on using tickets.