Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup max direct memory estimation via Unsafe #13650

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

franz1981
Copy link
Contributor

Motivation:

PlatformDependent::estimateMaxDirectMemory reflectevly allocates MX Beans to detect JVM's arg MaxDirectMemory (often failing to find any, because unconfigured).

Modifications:

Allow unsafe to find Bits's max memory static field and use it as a fast path to detect the same direct memory limits used by the JVM runtime

Result:

Faster and less memory hungry (in term of mallocs) startup

Porting of #13643

@franz1981 franz1981 self-assigned this Oct 5, 2023
@franz1981 franz1981 added this to In progress in Netty 5 via automation Oct 5, 2023
terminationFuture.setSuccess(null);
}
}
doShutdown(success);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franz1981 please revert... this is not related

Copy link
Member

@normanmaurer normanmaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert unrelated changes

Motivation:

PlatformDependent::estimateMaxDirectMemory reflectevly allocates MX Beans to detect JVM's arg MaxDirectMemory (often failing to find any, because unconfigured).

Modifications:

Allow unsafe to find Bits's max memory static field and use it as a fast path to detect the same direct memory limits used by the JVM runtime

Result:

Faster and less memory hungry (in term of mallocs) startup
@normanmaurer normanmaurer merged commit a0ed446 into netty:main Oct 11, 2023
14 checks passed
Netty 5 automation moved this from In progress to Done Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Netty 5
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants