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

[PyROOT] Memory leak when iterating over std::map from Python #9315

Closed
etejedor opened this issue Nov 19, 2021 · 1 comment · Fixed by #9386
Closed

[PyROOT] Memory leak when iterating over std::map from Python #9315

etejedor opened this issue Nov 19, 2021 · 1 comment · Fixed by #9386
Assignees

Comments

@etejedor
Copy link
Contributor

Reproducer taken from the forum (https://root-forum.cern.ch/t/memory-leak-using-root-std-map-int-t-float-t/47737):

import ROOT
allChannels = ROOT.std.map(’<Int_t,Float_t>’)()
allChannels[3]=5.
N=0
for n in range(10000000):
    for c in allChannels:
        N+=1
@etejedor etejedor self-assigned this Nov 19, 2021
@etejedor etejedor changed the title Memory leak when iterating over std::map from Python [PyROOT] Memory leak when iterating over std::map from Python Nov 19, 2021
@etejedor
Copy link
Contributor Author

etejedor commented Nov 19, 2021

It seems just invoking begin on the map is enough to trigger it:

for n in range(10000000):
    allChannels.begin()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant