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

Reduce header cache memory usage on non persistent requests #6494

Merged
merged 3 commits into from Jul 7, 2021

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Jul 5, 2021

Fix #6493. Delay creating a header cache until a second request on a parser.

Signed-off-by: Greg Wilkins gregw@webtide.com

Delay creating a header cache until a second request on a parser.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw gregw requested review from sbordet and lorban July 5, 2021 05:43
@gregw gregw added this to In progress in Jetty 10.0.7/11.0.7 FROZEN via automation Jul 5, 2021
Delay creating a header cache until a second request on a parser.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Copy link
Contributor

@lorban lorban left a comment

Choose a reason for hiding this comment

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

I think the logic is sound, but I don't like all those null checks of the two cache fields being scattered all around this class. It's probably worth extracting some of that logic into another FieldCache class IMHO.

Jetty 10.0.7/11.0.7 FROZEN automation moved this from In progress to Review in progress Jul 5, 2021
Refactored cache code into subclass

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw gregw requested a review from lorban July 6, 2021 04:48
Copy link
Contributor

@lorban lorban left a comment

Choose a reason for hiding this comment

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

This looks a million times better!

Jetty 10.0.7/11.0.7 FROZEN automation moved this from Review in progress to Reviewer approved Jul 6, 2021
@gregw gregw merged commit 8945a58 into jetty-10.0.x Jul 7, 2021
Jetty 10.0.7/11.0.7 FROZEN automation moved this from Reviewer approved to Done Jul 7, 2021
@gregw gregw deleted the jetty-10.0.x-6493-delayed-headerCache branch July 7, 2021 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

HttpParser.parsedHeader consume too much memory
2 participants