# Detach java agent runtime

**URL:** <https://discuss.elastic.co/t/detach-java-agent-runtime/191870>\
**Category:** APM\
**Tags:** java\
**Created:** [July 23, 2019, 4:41pm UTC](https://discuss.elastic.co/t/detach-java-agent-runtime/191870 "2019-07-23T16:41:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [July 26, 2019, 10:40am UTC](https://discuss.elastic.co/t/detach-java-agent-runtime/191870/2 "2019-07-26T10:40:21Z")

</div>

> [@gajanan8086](#):
>
> however the object pools and other threads will remain in the JVM.

What's your concern when these are still running?

Setting `elastic.apm.active` should do what you want and also gives you the possibility to activate the agent again at runtime.

> [@gajanan8086](#):
>
> I still see apm-reporter thread running

After a timeout of 5s this thread should stop too.

---

_[View the full topic](https://discuss.elastic.co/t/detach-java-agent-runtime/191870)._
