google-deepmind / google-deepmind/mujoco

Memory allocation error using Windows OS

Open
#2,337 8 comments 0 reactions 1 assignee Claimed by @okmatija View on GitHub
bug
Dominant language
C++
Stars
15.2k
Forks
1.8k
Avg merge
10d 16h
Merged PRs (30d)
25

Description

### Intro

Hi!

I am a PhD student at the Polytechnic University of Turin, I use MuJoCo for my research on muscle activity estimation.

I encountered a memory allocation error using Windows that is not present when running the same code with the same PC using WSL. Below is a minimal script to reproduce the error with the arm26.xml model.

CC involved collaborators: @vikashplus @vittorione94

### My setup

Python: 3.11.7
Mujoco: 3.2.6
OS: Windows 10
PC: Dell XPS 13 9310 (16GB RAM)

### What's happening? What did you expect?

When running the code attached below using Windows, I get `mujoco.FatalError: Could not allocate memory` at the i-th instance of MjData, despite the RAM being used by the process is lower than the available (<2GB used, >4GB available). When I run the same code using WSL on the same PC there are no errors if I have RAM available (I also report that the code is about 10 times faster in this case).
I would expect not to have this error if I still have memory available.

### Steps for reproduction

Run the code below using Windows OS.

### Minimal model for reproduction

arm26.xml

minimal XML

```XML































































```

### Code required for reproduction

```python
import mujoco

N = 10000

mj_model = mujoco.MjModel.from_xml_path('arm26.xml')
mj_datas = [None] * N
for i in range(N):
mj_datas[i] = mujoco.MjData(mj_model)
print(i)
```

### Confirmations

- [X] I searched the [latest documentation](https://mujoco.readthedocs.io/en/latest/overview.html) thoroughly before posting.
- [X] I searched previous [Issues](https://github.com/google-deepmind/mujoco/issues) and [Discussions](https://github.com/google-deepmind/mujoco/discussions), I am certain this has not been raised before.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.