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

Memory leak on destruction of ProcgenGym3Env #68

Open
jordan-schneider opened this issue Aug 12, 2021 · 0 comments
Open

Memory leak on destruction of ProcgenGym3Env #68

jordan-schneider opened this issue Aug 12, 2021 · 0 comments

Comments

@jordan-schneider
Copy link

jordan-schneider commented Aug 12, 2021

The following produces a memory leak

# leak.py
from procgen.env import ProcgenGym3Env
import numpy as np

n_envs = 100_000
timesteps = 10

for _ in range(n_miners):
        env = ProcgenGym3Env(1, "miner")
        for t in range(timesteps):
            env.act(np.array([5]))
            env.observe()
            env.get_info()

One can see this leak by installing memory-profiler

pip install memory-profiler

and running the mprof utility

mprof run -o multiple-envs-100000-10.dat leak.py; mprof plot -o leak.png multiple-envs-100000-10.dat

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

No branches or pull requests

1 participant