wlav / cppyy

Other
384 stars 38 forks source link

std::list leaks memory while std::vector does not #245

Open saraedum opened 4 days ago

saraedum commented 4 days ago

The following quickly eats through my RAM:

import cppyy
cppyy.cppdef(r"""
#include <list>
std::list<int> f() { return std::list<int>(3); }
""")
while True: _ = list(cppyy.gbl.f())

However, if I replace list with vector, memory consumption is stable.


This is with cppyy 3.1.2 from conda-forge on x86_64 Arch Linux.

saraedum commented 4 days ago

Same with a pip installed cppyy 3.1.2.