Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Memory leaks in numpy.nested_iters #19400

Closed
Stardust1225 opened this issue Jul 3, 2021 · 1 comment
Closed

BUG: Memory leaks in numpy.nested_iters #19400

Stardust1225 opened this issue Jul 3, 2021 · 1 comment
Labels
00 - Bug sprintable Issue fits the time-frame and setting of a sprint

Comments

@Stardust1225
Copy link

This code is generated by a fuzzing testing tool, and I find that the memory use is increasing as the times of calls.

Reproducing code example:

import sys
import tracemalloc
import numpy

memory_recorder = []
tracemalloc.start()
start_snapshot = tracemalloc.take_snapshot()
for i in range(0, 1000):
    try:
        numpy.nested_iters(['e', 'f'], [[1], [2]])
    except: pass
    if i % 100 == 0:
        one_snapshot = tracemalloc.take_snapshot()
        memory_recorder.append(one_snapshot.compare_to(start_snapshot, 'lineno')[0])

for i in range(1, len(memory_recorder)):
    print(memory_recorder[i].traceback)
    print(memory_recorder[i].size)
    print()

tracemalloc.stop()

Error message:

..py:15
16160

..py:15
32160

..py:15
48160

..py:15
64160

..py:15
80160

..py:15
96160

..py:15
112160

..py:15
128160

..py:15
144160

NumPy/Python version information:

In commit 6d9e294
Date: Thu Jul 1 09:42:16 2021

@seberg seberg added the 00 - Bug label Oct 4, 2021
@seberg seberg added the sprintable Issue fits the time-frame and setting of a sprint label May 11, 2022
@InessaPawson InessaPawson changed the title Memory leaks in function numpy.nested_iters BUG: Memory leaks in numpy.nested_iters Aug 24, 2022
@clearspear
Copy link
Contributor

Looking into this as part of the Grace Hopper OSD NumPy sprint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug sprintable Issue fits the time-frame and setting of a sprint
Projects
None yet
Development

No branches or pull requests

4 participants