Skip to content

FLINK-39968 [core] Reduce redundant AtomicBoolean allocation in MemorySegment to improve construction performance#28514

Open
YYKI wants to merge 1 commit into
apache:masterfrom
YYKI:FLINK-39968
Open

FLINK-39968 [core] Reduce redundant AtomicBoolean allocation in MemorySegment to improve construction performance#28514
YYKI wants to merge 1 commit into
apache:masterfrom
YYKI:FLINK-39968

Conversation

@YYKI

@YYKI YYKI commented Jun 23, 2026

Copy link
Copy Markdown

What is the purpose of the change

Reduce redundant AtomicBoolean allocation in MemorySegment to improve construction performance

Brief change log

  • Replace the member variable final AtomicBoolean isFreedAtomic with a primitive boolean isFreed;
  • Add the synchronized modifier to the free() method to ensure the atomicity and thread safety of the free state judgment and modification;

Verifying this change

This change is already covered by existing tests, such as MemorySegmentTestBase.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (yes )
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

…in MemorySegment to improve construction performance

1 Replace the member variable final AtomicBoolean isFreedAtomic with a primitive boolean isFreed;
2 Add the synchronized modifier to the free() method to ensure the atomicity and thread safety of the free state judgment and modification;
@flinkbot

flinkbot commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@YYKI YYKI changed the title FLINK-39968 [Optimization] Reduce redundant AtomicBoolean allocation in MemorySegment to improve construction performance FLINK-39968 [core] Reduce redundant AtomicBoolean allocation in MemorySegment to improve construction performance Jun 23, 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