Open romtsn opened 1 year ago
Is there a new spike of these or could they just be coming from devices with very limited resources? In other words should we investigate any newly introduced increase in memory consumption?
Let's start simple:
A heap analysis done by a customer shows Span
objects holding large stacktraces (preventing GC) for a timeframe of over 2+ hours. This definitely doesn't sound right.
After a quick test with our sentry-springboot example I can't seem to reproduce this easily. Scenario:
Use sentry-springboot example
Capture an exception on every request
@PostMapping
Person create(@RequestBody Person person) {
Sentry.captureException(new IllegalStateException("oh no"));
return personService.create(person);
}
Flood the service with 1k requests
i=0
max=1000
while [ $i -lt $max ]
do
curl -XPOST --user user:password http://localhost:8080/person/ -H "Content-Type:application/json" -d '{"firstName":"John","lastName":"Smith"}'
true $(( i++ ))
sleep 2
done
Analyze the heap using mat
Tried a few variations as well, same picture: no leaking spans.
Throwing an uncaught exception
@PostMapping
Person create(@RequestBody Person person) {
throw new IllegalStateException("oh no");
// return personService.create(person);
}
Attaching a stack trace to a span
@PostMapping
Person create(@RequestBody Person person) {
final ISpan span = Sentry.getSpan().startChild("op.bad");
span.setThrowable(new RuntimeException("bad things happened"));
span.finish(SpanStatus.UNKNOWN_ERROR);
return personService.create(person);
}
@lbloder we recently got a report from a sentry-java
springboot customer regarding spans with stacktraces leaking and leading to OOMs. I tried a few basics (See comments ^ above). Feel free to chime in if you have any more ideas what could cause spans to be retained.
Some more details from our customer setup:
I'm wondering if this could be related to some background workers having long running transactions.
@markushi I'm a bit confused on They do not have any integrations active
:
sentry-spring-boot
dependency manually, is that correct?gradle
or maven
plugin for installation?sentry-java
sdk?Also, it might be of relevance if they are using SpringBoot < 3 or not.
And, one more thing that could help us narrow down the search space is whether they are using WebFlux
.
I'll have a look into that as well.
@lbloder thanks for the details, let me reach out to them!
it occurred also in CpuCollector on Android
Description
From play console: