Skip to content

fix: insufficient shared memory available in Unity 6.6 beta#841

Open
mob-sakai wants to merge 1 commit into
game-ci:mainfrom
mob-sakai:fix/support-unity6.6
Open

fix: insufficient shared memory available in Unity 6.6 beta#841
mob-sakai wants to merge 1 commit into
game-ci:mainfrom
mob-sakai:fix/support-unity6.6

Conversation

@mob-sakai

@mob-sakai mob-sakai commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Changes

  • On Unity 6.6 (beta)/6.7 (alpha), tests and builds fail with the following error:
Error:  Requested 1073741824 bytes, but only 67108864 bytes available
Error:  Insufficient shared memory available - if using Docker, please run the container with --shm-size=1025M
  • Following the instructions, I added --shm-size=1025m as an argument to docker run and tests and builds completed successfully.

Related Issues

Related PRs

  • none

Successful Workflow Run Link

PRs don't have access to secrets so you will need to provide a link to a successful run
of the workflows from your own repo.

Checklist

  • Read the contribution guide and accept the code of conduct
  • Docs (If new inputs or outputs have been added or changes to behavior that should be documented. Please make a PR
    in the documentation repo)
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

Summary by CodeRabbit

Summary

  • Bug Fixes
    • Updated the generated Docker run command to include --shm-size=1025m (for both Linux and Windows execution paths), improving reliability for memory-intensive workloads inside containers.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Cat Gif

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fb14acb6-350d-4867-8088-d67dfda3011d

📥 Commits

Reviewing files that changed from the base of the PR and between 6d3e4dc and bc9b9ac.

⛔ Files ignored due to path filters (3)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
  • dist/licenses.txt is excluded by !**/dist/**
📒 Files selected for processing (1)
  • src/model/docker.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/model/docker.ts

📝 Walkthrough

Walkthrough

Adds --shm-size=1025m to both Linux and Windows Docker run command templates.

Changes

Docker Shared Memory Size Configuration

Layer / File(s) Summary
Add --shm-size flag to Docker commands
src/model/docker.ts
Inserts --shm-size=1025m into both docker run command templates.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

Suggested reviewers: GabLeRoux

Poem

A bunny hopped through Docker night,
And gave the shared memory more room just right.
Linux and Windows now build with cheer,
With a little extra shm held near. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding shared-memory support for Unity 6.6 beta.
Description check ✅ Passed The description follows the template and includes changes, related issue, workflow links, and checklist items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.34%. Comparing base (d829bfc) to head (bc9b9ac).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #841   +/-   ##
=======================================
  Coverage   45.34%   45.34%           
=======================================
  Files          36       36           
  Lines         688      688           
  Branches      199      199           
=======================================
  Hits          312      312           
  Misses        337      337           
  Partials       39       39           
Files with missing lines Coverage Δ
src/model/docker.ts 0.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/model/docker.ts (1)

71-71: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Duplicated magic value 1025m across both templates.

The shared memory size literal is duplicated verbatim in both getLinuxCommand and getWindowsCommand. Extracting it to a named constant would make the rationale (matching Unity's exact 1025M request) clearer and avoid future drift if one copy is updated without the other.

♻️ Proposed refactor
+const DOCKER_SHM_SIZE = '1025m';
+
 class Docker {
     return `docker run \
-            --shm-size=1025m \
+            --shm-size=${DOCKER_SHM_SIZE} \
             --workdir ${dockerWorkspacePath} \
     return `docker run \
-            --shm-size=1025m \
+            --shm-size=${DOCKER_SHM_SIZE} \
             --workdir c:${dockerWorkspacePath} \

Also applies to: 119-119

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/model/docker.ts` at line 71, The shared memory size value is duplicated
in both command builders, so extract the `1025m` literal into a named constant
and reuse it from `getLinuxCommand` and `getWindowsCommand`. Update the Docker
command templates to reference that shared constant so the Unity-specific shared
memory requirement stays consistent in one place and avoids drift between the
two methods.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/model/docker.ts`:
- Line 71: The shared memory size value is duplicated in both command builders,
so extract the `1025m` literal into a named constant and reuse it from
`getLinuxCommand` and `getWindowsCommand`. Update the Docker command templates
to reference that shared constant so the Unity-specific shared memory
requirement stays consistent in one place and avoids drift between the two
methods.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2a523b0e-be3b-4b9b-97bb-3128c54fa3d4

📥 Commits

Reviewing files that changed from the base of the PR and between d829bfc and 0d7771e.

⛔ Files ignored due to path filters (3)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
  • dist/licenses.txt is excluded by !**/dist/**
📒 Files selected for processing (1)
  • src/model/docker.ts

@mob-sakai mob-sakai force-pushed the fix/support-unity6.6 branch from 0d7771e to 6d3e4dc Compare July 4, 2026 00:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/model/docker.ts (1)

71-71: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix looks correct; consider making shm-size configurable.

The hardcoded --shm-size=1025m matches the value recommended in the reported Docker error and resolves the reported build failures. Since dockerCpuLimit/dockerMemoryLimit are already exposed as configurable DockerParameters, consider exposing shm-size similarly so users with different project sizes/CI environments can tune it without a code change.

♻️ Optional: expose as a parameter
-    return `docker run \
-            --shm-size=1025m \
+    return `docker run \
+            --shm-size=${dockerShmSize ?? '1025m'} \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/model/docker.ts` at line 71, The Docker setup in docker.ts hardcodes the
shm-size value, so make it configurable like dockerCpuLimit and
dockerMemoryLimit in DockerParameters. Update the Docker command-building logic
to accept a shm-size parameter and thread it through the same path used by the
existing configurable limits, so users can tune the shared memory setting
without changing code.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/model/docker.ts`:
- Line 71: The Docker setup in docker.ts hardcodes the shm-size value, so make
it configurable like dockerCpuLimit and dockerMemoryLimit in DockerParameters.
Update the Docker command-building logic to accept a shm-size parameter and
thread it through the same path used by the existing configurable limits, so
users can tune the shared memory setting without changing code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 238fa1b1-710a-4a6f-a0c1-b05c1d8af6d0

📥 Commits

Reviewing files that changed from the base of the PR and between 0d7771e and 6d3e4dc.

⛔ Files ignored due to path filters (3)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
  • dist/licenses.txt is excluded by !**/dist/**
📒 Files selected for processing (1)
  • src/model/docker.ts

@mob-sakai mob-sakai force-pushed the fix/support-unity6.6 branch from 6d3e4dc to bc9b9ac Compare July 4, 2026 07:48
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

Successfully merging this pull request may close these issues.

1 participant