# APM Java agent read elasticapm.properties, resulting in application startup failure

**URL:** <https://discuss.elastic.co/t/apm-java-agent-read-elasticapm-properties-resulting-in-application-startup-failure/374538>\
**Category:** APM\
**Tags:** java\
**Created:** [February 14, 2025, 7:04am UTC](https://discuss.elastic.co/t/apm-java-agent-read-elasticapm-properties-resulting-in-application-startup-failure/374538 "2025-02-14T07:04:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arT1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/art1/32/137703_2.png) [@arT1](https://discuss.elastic.co/u/arT1)\
**Post date:** [February 14, 2025, 7:04am UTC](https://discuss.elastic.co/t/apm-java-agent-read-elasticapm-properties-resulting-in-application-startup-failure/374538/1 "2025-02-14T07:04:26Z")

</div>

Elastic stack v8.13.3  
JVM: -Xms2g -Xmx2g -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512m -javaagent:/opt/apm/elastic-apm-agent-1.52.1.jar -Delastic.apm.config\_file=/opt/apm/elasticapm.properties

elasticapm.properties

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/7/9795d1459cd8b6078dfad516a2e28e855e1de01d.png)

agent.log

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/f/ffd62c9e75b322cf5bbf7e8582547aed31ceb95d.png)

app run log

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/3/231b6909fe6e6879ba727768337a17349a0a66d6.png)

---

<div class="post-metadata">

**Author:** ![arT1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/art1/32/137703_2.png) [@arT1](https://discuss.elastic.co/u/arT1)\
**Post date:** [February 14, 2025, 8:13am UTC](https://discuss.elastic.co/t/apm-java-agent-read-elasticapm-properties-resulting-in-application-startup-failure/374538/2 "2025-02-14T08:13:41Z")

</div>

I have referenced this discussion: [JVM corrupted with java agent 1.19.0 - CentOS - #5 by Eyal\_Koren](https://discuss.elastic.co/t/jvm-corrupted-with-java-agent-1-19-0-centos/257599/5)  
and deleted the profile\_inferred\_spans\_enabled: true  
The application starts normally, the apm is normal  
Can anyone tell me why?

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [February 17, 2025, 10:35am UTC](https://discuss.elastic.co/t/apm-java-agent-read-elasticapm-properties-resulting-in-application-startup-failure/374538/3 "2025-02-17T10:35:24Z")

</div>

Hi, thanks for reporting this!

The discussion you are referring to relates to a very old version that triggered similar JVM crashes, so this is the same symptom and unlikely the same underlying issue.

Inferred spans are a "technical preview" feature as written in the documentation [here](https://www.elastic.co/guide/en/apm/agent/java/current/method-sampling-based.html).

If you really need inferred spans, I would suggest to switch to the [EDOT Java agent](https://github.com/elastic/elastic-otel-java) as it uses a more recent version of async-profiler which is unlikely to trigger the same JVM crash. If it still does, please report it so we can further investigate and maybe help fix this upstream.
