Skip to content

Reduce allocation pressure#2

Closed
MoePus wants to merge 1 commit into
RelativityMC:masterfrom
MoePus:Reduce-GC
Closed

Reduce allocation pressure#2
MoePus wants to merge 1 commit into
RelativityMC:masterfrom
MoePus:Reduce-GC

Conversation

@MoePus
Copy link
Copy Markdown

@MoePus MoePus commented Jun 1, 2026

This PR reduces allocation pressure in FlowSched hot paths.

Changes:

  • Avoid allocating FreeableTaskList for tasks without lock tokens.
  • Reuse a shared empty LockToken[] for SimpleTask.
  • Lazily allocate per-status ticket sets in TicketSet.

In my worldgen stress test, JFR showed ExecutorManager.tryLock() / FreeableTaskList as a major allocation source before this change. After the patch, that allocation site disappeared from the top allocation sites.

Observed result in the my test setup:

  • allocation rate dropped from 6 GB/s to 3.5 GB/s
  • GC intervals became noticeably longer
  • per-worker FlowSched/C2ME allocation pressure was significantly reduced in JFR

This pr was coworked with Codex

@MoePus
Copy link
Copy Markdown
Author

MoePus commented Jun 1, 2026

Didnt noticed that 1.21 c2me is different commit hash with lastest RelativityMC's master branch
I would solve the conflict and reopen this pr

@MoePus MoePus closed this Jun 1, 2026
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