[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: high memory usage by spdet / memory leak?
From: |
David Bateman |
Subject: |
Re: high memory usage by spdet / memory leak? |
Date: |
Tue, 10 May 2005 09:55:38 +0200 |
User-agent: |
Mozilla Thunderbird 0.8 (X11/20040923) |
Dmitri A. Sergatskov wrote:
I do not understand why spdet() uses as much memory as it does.
By doing
octave:> n=6000; a=speye(n,n)+0.01*sprandn(n,n,0.001);
octave:> whos a
*** local user variables:
Prot Name Size Bytes Class
==== ==== ==== ===== =====
rwd a 6000x6000 527740 sparse matrix
Total is 41978 elements using 527740 bytes
octave:> spdet(a)
the octave size grows to 476 MB.
The memory stay that high after the execution (it goes slightly above
600MB during
calculations).
The size seems to increase as N^2 and execution time as N^4.
The resident memory size seems to increase after successive execution
of spdet()
on the same dataset. The loop:
for i = (1:100) ; spdet(a); endfor
was eventually aborted with
error: SparseMatrix::determinant numeric factorization failed
error: evaluating for command near line 17, column 1
At this moment Octave Virt/Res memory usage was 1190MB/704M
Sincerely,
Dmitri.
Try the following patch
2005-04-29 David Bateman <address@hidden>
* dSparse.cc (determinant): Free numeric factorization after
sucessful calculation.
* CSparse.cc (determinant): ditto.
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax)
91193 Gif-Sur-Yvette FRANCE
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
*** liboctave/dSparse.cc~ 2005-05-02 10:44:13.000000000 +0200
--- liboctave/dSparse.cc 2005-05-10 09:53:17.498788864 +0200
***************
*** 817,827 ****
UMFPACK_DNAME (report_status) (control, status);
UMFPACK_DNAME (report_info) (control, info);
-
- UMFPACK_DNAME (free_numeric) (&Numeric);
}
else
retval = DET (d);
}
}
}
--- 817,827 ----
UMFPACK_DNAME (report_status) (control, status);
UMFPACK_DNAME (report_info) (control, info);
}
else
retval = DET (d);
+
+ UMFPACK_DNAME (free_numeric) (&Numeric);
}
}
}
*** liboctave/CSparse.cc~ 2005-05-02 10:44:08.000000000 +0200
--- liboctave/CSparse.cc 2005-05-10 09:53:10.483254763 +0200
***************
*** 738,748 ****
UMFPACK_ZNAME (report_status) (control, status);
UMFPACK_ZNAME (report_info) (control, info);
-
- UMFPACK_ZNAME (free_numeric) (&Numeric);
}
else
retval = ComplexDET (d);
}
}
}
--- 738,748 ----
UMFPACK_ZNAME (report_status) (control, status);
UMFPACK_ZNAME (report_info) (control, info);
}
else
retval = ComplexDET (d);
+
+ UMFPACK_ZNAME (free_numeric) (&Numeric);
}
}
}