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

Adds support for counting agent jar classes in memory calculator #166

Merged
merged 3 commits into from
May 5, 2022

Conversation

pivotal-david-osullivan
Copy link
Contributor

Summary

Currently, if multiple agent jars are added to JAVA_TOOL_OPTS, the container can hit an OOM error due to a lack of Metaspace. This is because agent jar classes are not counted in the memory calculator and sufficient Metaspace is not reserved.
This PR counts the classes of agent jars in JAVA_TOOL_OPTS, the total of which is added to the memory calculator's equation.

Use Cases

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@pivotal-david-osullivan pivotal-david-osullivan added semver:patch A change requiring a patch version bump type:enhancement A general enhancement labels May 4, 2022
@pivotal-david-osullivan pivotal-david-osullivan requested a review from a team May 4, 2022 09:14
Copy link
Contributor

@dmikusa dmikusa left a comment

Choose a reason for hiding this comment

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

Looks really good. Your idea to look at the -javaagent arguments is much more elegant than what I was thinking.

A couple of minor thoughts included below.

helper/memory_calculator.go Outdated Show resolved Hide resolved
helper/memory_calculator_test.go Show resolved Hide resolved
count/count_classes.go Outdated Show resolved Hide resolved
@dmikusa dmikusa merged commit 2055730 into main May 5, 2022
@dmikusa dmikusa deleted the agent-class-count branch May 5, 2022 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants