Every time I run Isaac Sim from python it causes about ~0.4GB of system memory to become persistently unavailable. This memory is locked up even after the run completes (with no explanation for its use that I can find). The only way I have found to restore the memory is to reboot the machine. My only guess is that the memory is being leaked by the driver.
This occurs with code as simple as starting then closing SimulationApp
. It occurs both natively and when run from within singularity container (converted from the docker image) where the host’s memory remains unavailable after the container is closed.
My environment:
- Ubuntu 20.04.5 LTS
- Isaac Sim 2022.2.0
- Driver version 525.85.12
- GPUs: GeForce RTX 2080 Ti & GeForce RTX 3090
Code to reproduce the memory leak:
#!/usr/bin/env python
import subprocess
from pathlib import Path
def run(python: Path):
print_memory()
for _ in range(30):
subprocess.run(
[
str(python),
"-c",
"; ".join(
[
"from omni.isaac.kit import SimulationApp",
"app = SimulationApp({'headless': True})",
"app.close()",
]
),
],
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
)
print_memory()
def print_memory():
with open("/proc/meminfo", "r") as f:
for line in f:
if line.startswith("MemAvailable"):
print(line.strip())
return
for path in [
Path("/isaac-sim"),
Path.home() / ".local" / "share" / "ov" / "pkg" / "isaac_sim-2022.2.0",
]:
if path.exists():
isaac_sim_python = path / "python.sh"
break
else:
raise ValueError("Isaac sim path not found")
run(isaac_sim_python)