-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
2.0.0.M7 “spring-boot-starter-actuator” caused OOM #11338
Comments
after my application runned 24 hours, it will be shown. |
dump the memory, amost all objects is instances of org/LatencyUtils/LatencyStats$PauseTracker . |
Could you report that issue to https://github.com/micrometer-metrics/micrometer ? |
Possibly related to #11333 |
Only vaguely in that they are related to the same mechanism. |
@chenjinkai Are you super positive that this is running on Boot 2 M7 and that you have a version of micrometer >= 1.0.0-rc.4 on your runtime classpath? We had a memory leak in 1.0.0-rc.3 (Boot 2 M6) that was fixed in rc4. It's not impossible that there is still a leak, but I'm having a difficult time reproducing it. |
One idea: perhaps you have a custom metric that is running up the cardinality on a particular tag? In effect, you create a separate |
Here's some plotting of a test app running with micrometer-core:1.0.0-rc.4 (~4 weeks) and rc.5 (~11 hours). No problems observable. Note, this is with a steady amount of meters. Now - as Jon said - produce Timers on a steady basis with changing tag values, actually making them distinct metrics on each construction one can quickly get to OOMs. Testapp with -Xmx64m with Timer created every second with a distinct tag. Does lead to OOM within minutes. I'd second @jkschneider wrt tag cardinality "problem" on user side. |
Thanks @mweirauch ! @chenjinka, let us know if you can reproduce this consistently with a recent version and/or if it's actually about creating multiple Timers for tags/name combinations. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
Looks like we encountered the same issue, when migrated our application from M5 to M7. It is stable reproduces twice per day, so I can try to provide more data, but I'm not sure that we will be able to reproduce it in more managed environment. Anyway I think the issue itself should be reopened and somehow solved. |
Some additional information. We have two services on M7 with the same load. The interesting that the second service is OK, while the first one is stable leaking. The main difference is that the first service uses RestTemplate to call the second service. |
@erlioniel that's interesting. Could you please give it a try with |
@erlioniel Also, can you verify the cardinality of all meters you have in your app? A runaway tag value on a timer will cause an OOM eventually. |
@snicoll okay, sounds a bit risky but we will try tomorrow. |
If you have 5,850
You'll have to specifically enable that actuator endpoint in Boot 2. Just a guess, but I suspect you have a lot of tags because the app is pre-filling path variables:
|
@snicoll We currently have a @adriancole FYI. We might consider a similar option in Brave. |
I am not sure I agree with that statement. Perhaps we should make the instrumentation of |
@jkschneider Yes, your assumption was correct. Looks like we are using restTemplate in a wrong way and spring creates a new tag for every single request. URI uri = fromUri(path)
.queryParam("param", value)
.build().encode().toUri();
return restTemplate.getForObject(uri, Entity.class); Should I check SNAPSHOT version or it is correct behavior of the framework? If it is I think there should be more clear way to avoid the problem like this, because it isn't easy to debug and fix actually. |
@jkschneider @snicoll |
I will leave my solution here, just for devs who will look how to disable / change tags for RestTemplate metrics or will fight with the same issue.
P.S. Will not work with path variables |
@erlioniel So, in your case, it was the query parameters that were causing the problem rather than path variables? |
Agreed. My plan is to add a |
@wilkinsona yes |
@jkschneider nice plan btw, is there any issue for that? Just to follow. |
Also I will leave this link here :) spring-cloud/spring-cloud-netflix@5a127d0 |
@erlioniel Here is the associated Micrometer issue: micrometer-metrics/micrometer#363 |
maybe this jar will caused the OOM problem
org.latencyutils LatencyUtils 2.0.3The text was updated successfully, but these errors were encountered: