def test__memory_usage(self):
    """Make sure memory usage is low when not recording videos."""
    # This test has to go first, so that memory usage is not affected.
    if 'UNITTEST_IN_DOCKER' in os.environ:
      # Forge doesn't support rendering.
      return
    cfg = config.Config({'write_video': False})
    env = football_env.FootballEnv(cfg)
    env.render()
    env.reset()
    initial_memory = self.memory_usage()
    for _ in range(100):
      _, _, _, _ = env.step(football_action_set.action_right)
    memory_usage = self.memory_usage() - initial_memory
    env.close()
    self.assertGreaterEqual(10000000, memory_usage)
Make sure memory usage is low when not recording videos.
gfootball/env/football_env_test.py