Skip to content

possible memory leak in matrix code? #4631

@craigcitro

Description

@craigcitro

So I was looking at another ticket, and noticed the following memory usage of Hermite normal form:

sage: M = random_matrix(ZZ,50,50)

sage: get_memory_usage()
'1104M+'

sage: for _ in range(100): foo = M.hermite_form()
   ....: 

sage: get_memory_usage()
'1170M+'

It could be that the memory is getting "lost" in some other way, but it might be nice to see why it's happening. In fact, it's probably got nothing to do with HNF:

sage: get_memory_usage()
'1170M+'

sage: for _ in range(100): foo = M.echelon_form()
   ....: 

sage: get_memory_usage()
'1237M+'

I'm happy to find out that there's a reasonable explanation for this.

CC: @robertwb

Component: memleak

Issue created by migration from https://trac.sagemath.org/ticket/4631

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions