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

Potential Memory Leak in CarRacing-V0 #2155

Closed
SwapnilPande opened this issue Jan 11, 2021 · 1 comment
Closed

Potential Memory Leak in CarRacing-V0 #2155

SwapnilPande opened this issue Jan 11, 2021 · 1 comment

Comments

@SwapnilPande
Copy link

I noticed memory usage was increasing while training an RL agent using the CarRacing-V0 environment. Looks similar to #1882.

I was able to isolate the issue to the gym environment by running the following code with a memory profiler:

import gym

env = gym.make('CarRacing-v0')
env.reset()
for i in range(500_000):
    # env.render()
    _, _, done, _ = env.step(env.action_space.sample())
    if done:
        env.reset()

env.close()

The memory profiler returned the following plot.:
car_racing_mem_leak

When only running env.reset in the loop, I get the following memory growth behavior:

import gym

env = gym.make('CarRacing-v0')
env.reset()
for i in range(500_000):
    env.reset()

env.close()

car-racing-only-reset

When only calling reset(), the memory consumption seems to grow slower, but grows nevertheless.

@SwapnilPande
Copy link
Author

#2096 Addresses this issue.

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

No branches or pull requests

2 participants