Skip to content

Conversation

@gxxk-dev
Copy link

tcmalloc assumes a 48-bit virtual address space, causing crashes on ARM64 systems with smaller VA space (e.g., 39-bit or 42-bit).

This PR restricts tcmalloc to x86_64 Linux only. ARM64 will use the default system allocator.

Tested on ARM64 Linux (Orange Pi RK3588):

  • workerd builds and runs successfully
  • 387 tests pass
  • 29 timeouts are unrelated (due to slower ARM64 performance, tests pass when run individually)
  • Hello World example works correctly

Fixes crashes with error: MmapAligned() failed - unable to allocate

@gxxk-dev gxxk-dev requested review from a team as code owners November 22, 2025 06:57
@github-actions
Copy link

github-actions bot commented Nov 22, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@gxxk-dev
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 22, 2025

CodSpeed Performance Report

Merging #5571 will degrade performances by 8.33%

Comparing gxxk-dev:fix-tcmalloc-arm64 (071eace) with main (1413843)

Summary

❌ 1 regression
✅ 56 untouched
⏩ 30 skipped1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
simpleStringBody[Response] 21.4 µs 23.3 µs -8.33%

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  tcmalloc assumes a 48-bit virtual address space, causing crashes on
  ARM64 systems with smaller VA space (e.g., 39-bit or 42-bit).

  Restrict tcmalloc to x86_64 Linux only. ARM64 will use the default
  system allocator.

  Tested on ARM64 Linux (Orange Pi RK3588): workerd runs successfully,
  387 tests pass (29 unrelated timeouts due to slower ARM64 performance).
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