How to check for memory leaks?

Hi All, I'm suspecting a possible memory leak in 1.11.x, what is the best way to check for that? Chuck

On Tue, 23 Feb 2016 12:36:00 -0700 Charles R Harris <charlesr.harris@gmail.com> wrote:
If that is due to a reference leak, you can use sys.getrefcount() or weakref.ref(). Otherwise you may want to change Numpy to go through PyMem_RawMalloc / PyMem_RawCalloc / PyMem_RawRealloc / PyMem_RawFree on recent Pythons, so as to have Numpy-allocated memory accounted by the tracemalloc module. (https://github.com/numpy/numpy/pull/5470 may make it more palatable ;-)) Regards Antoine.

On Di, 2016-02-23 at 12:36 -0700, Charles R Harris wrote:
Would like to learn better methods, but I tried valgrind with trace origins and full leak check, just thinking maybe it shows something. Unfortunately, I got the error below midway, I ran it before successfully (with only minor obvious leaks due to things like module wide strings) I think. My guess is, the error does not say much at all, but I have no clue :) (running without track-origins now, maybe it helps). - Sebastian Error: VEX temporary storage exhausted. Pool = TEMP, start 0x38f91668 curr 0x39456190 end 0x394561a7 (size 5000000) vex: the `impossible' happened: VEX temporary storage exhausted.

On Tue, 23 Feb 2016 12:36:00 -0700 Charles R Harris <charlesr.harris@gmail.com> wrote:
If that is due to a reference leak, you can use sys.getrefcount() or weakref.ref(). Otherwise you may want to change Numpy to go through PyMem_RawMalloc / PyMem_RawCalloc / PyMem_RawRealloc / PyMem_RawFree on recent Pythons, so as to have Numpy-allocated memory accounted by the tracemalloc module. (https://github.com/numpy/numpy/pull/5470 may make it more palatable ;-)) Regards Antoine.

On Di, 2016-02-23 at 12:36 -0700, Charles R Harris wrote:
Would like to learn better methods, but I tried valgrind with trace origins and full leak check, just thinking maybe it shows something. Unfortunately, I got the error below midway, I ran it before successfully (with only minor obvious leaks due to things like module wide strings) I think. My guess is, the error does not say much at all, but I have no clue :) (running without track-origins now, maybe it helps). - Sebastian Error: VEX temporary storage exhausted. Pool = TEMP, start 0x38f91668 curr 0x39456190 end 0x394561a7 (size 5000000) vex: the `impossible' happened: VEX temporary storage exhausted.
participants (3)
-
Antoine Pitrou
-
Charles R Harris
-
Sebastian Berg