Skip to content

Reduce allocation pressure#3

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

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

Conversation

@MoePus

@MoePus MoePus commented Jun 1, 2026

Copy link
Copy Markdown

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

@ishland

ishland commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Merged as 5a04b36 d6186df fae2126

@ishland ishland closed this Jun 14, 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.

2 participants