Skip to content

Reduce allocation pressure#3

Open
MoePus wants to merge 1 commit into
RelativityMC:masterfrom
MoePus:Reduce-GC-rebased-with-lastest
Open

Reduce allocation pressure#3
MoePus wants to merge 1 commit into
RelativityMC:masterfrom
MoePus:Reduce-GC-rebased-with-lastest

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
This pr is the re-targeted version of #2

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