dd-trace-java
dd-trace-java copied to clipboard
High Startup Resources
Hi, I am trying to deploy Micronaut v3.5.4 to production. What I noticed is, that when I try to directly run the jar it takes about ~700 ms to startup and around ~25% CPU when given a single core. But the same changes to ~1800ms and 300% CPU when starting the same jar with datadog-java agent. Is this really expected because it is beating the purpose of fast startups and low resources overhead?
The used memory just after bootup is also significantly more
Hi @sidhant92 the tracer does need to use CPU and heap during startup (and warmup of the application) to analyse which classes to instrument for tracing purposes. We are looking at ways to reduce this overhead and I'll update this issue when we have something you can test.
The 1.14.0 release contains a number of startup improvements that could help here
Startup overhead was reduced by https://github.com/DataDog/dd-trace-java/pull/5026 - this feature also lets you persist type-matching data using DD_RESOLVER_CACHE_DIR=<writable-directory>
which means less overhead when restarting.
There have been further minor improvements since then, I recommend trying the latest release 1.20.0