-
Notifications
You must be signed in to change notification settings - Fork 70
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
Use Runtime.getRuntime().totalMemory() to calculate 1% of the heap memory #204
Comments
The commit that added it goes back to fd6ab10. Off the top of my head, I suppose 1% of the max heap probably makes more sense than the somewhat arbitrary measure of currently allocated heap. It's interesting this hasn't come up before. Did you run into an issue where your reporter queue was limited by the queued max bytes? I suppose this isn't an issue in the case |
I didn't run into an issue where my queue was limited by the queued max bytes. Actually, I am trying to understand the role of using
1% of the heap memory mentioned here should refer to the heap memory set by So actually I have another question about |
This default value was made for a simple default, and the sizing is imprecise for sure. I don't expect we'll want the complexity to try for precise sizing, neither try to be more heuristic about max size and assume users want to pre-allocate a larger heap for span reporting reasons alone (e.g. to make sure we use max value). The best way out would be to
I don't expect there to be value in doing more than this until there are more active maintainers, who are able to maintain the project and also maintain a more sophisticated sizing engine. |
Detailed rationale in RATIONALE.md Closes #204 Closes openzipkin/brave#1426 Signed-off-by: Adrian Cole <adrian@tetrate.io>
Detailed rationale in RATIONALE.md Closes #204 Closes openzipkin/brave#1426 Signed-off-by: Adrian Cole <adrian@tetrate.io>
By default, 1% of memory is used as the queue memory limit in
AsyncReporter
:It uses
Runtime.getRuntime().totalMemory()
which is that the JVM has allocated thus far. This isn't necessarily what is in use or the maximum.Is this calling the wrong API or is it designed that way? From what I understand, it seems like
maxMemory
should be used here? WithtotalMemory
, the byte limit is different each time the app is started.The text was updated successfully, but these errors were encountered: