osqp / qdldl-python

Python interface to the QDLDL(https://github.com/osqp/qdldl) free LDL factorization routine for quasi-definite linear systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory leak

ajfriend opened this issue · comments

I think there's a memory leak somewhere. For example, if I run many repeated solves with a single factorization, I see the memory consumption jump up much higher than it should.

Here's a simple example that makes it pretty obvious on my laptop:

import scipy.sparse as sp
import numpy as np
import qdldl as ldl

N = int(1e4)
runs = int(1e5)

A = sp.eye(N, format='csc', dtype='float64')
b = np.random.randn(N)

F = ldl.Solver(A)
# memory usage is fine up to this point

# memory usage goes through the roof with many repeated solves
for i in range(runs):
    F.solve(b)