# Monitoring the memory use of our application

**URL:** <https://discuss.elastic.co/t/monitoring-the-memory-use-of-our-application/121516>\
**Category:** APM\
**Created:** [February 26, 2018, 3:15pm UTC](https://discuss.elastic.co/t/monitoring-the-memory-use-of-our-application/121516 "2018-02-26T15:15:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![orfeu65](https://avatars.discourse-cdn.com/v4/letter/o/f07891/32.png) [@orfeu65](https://discuss.elastic.co/u/orfeu65)\
**Post date:** [February 26, 2018, 3:15pm UTC](https://discuss.elastic.co/t/monitoring-the-memory-use-of-our-application/121516/1 "2018-02-26T15:15:09Z")

</div>

Hello!  
I am testing APM and I see that it measures and analyzes response times and number of requests. It is great. But we are interested in the memory usage of our application. The memory that is used by each request and when it grows. We want to find memory leaks. We use django/python. Is it possible to do it using APM, or do you plan to add this funcionality?  
Thanks!

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [February 27, 2018, 1:46am UTC](https://discuss.elastic.co/t/monitoring-the-memory-use-of-our-application/121516/2 "2018-02-27T01:46:03Z")

</div>

Thanks for trying out APM, glad to know it's working well for you so far!

We are starting to look into support for application stats now, but it's still early days: [https://github.com/elastic/apm-server/pull/650](https://github.com/elastic/apm-server/pull/650). That work doesn't describe what exact stats agents will measure out of the box, but I think it would be reasonable to expect heap allocation will be one of them.

---

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [February 27, 2018, 5:07pm UTC](https://discuss.elastic.co/t/monitoring-the-memory-use-of-our-application/121516/3 "2018-02-27T17:07:08Z")

</div>

For now we recommend using [Metricbeat](https://www.elastic.co/products/beats/metricbeat) to collect CPU and memory usage. This data will also go into your Elasticsearch cluster, but as Andrew mentioned it's not integrated into the APM graphs yet.

---

<div class="post-metadata">

**Author:** ![orfeu65](https://avatars.discourse-cdn.com/v4/letter/o/f07891/32.png) [@orfeu65](https://discuss.elastic.co/u/orfeu65)\
**Post date:** [March 2, 2018, 5:58pm UTC](https://discuss.elastic.co/t/monitoring-the-memory-use-of-our-application/121516/4 "2018-03-02T17:58:53Z")

</div>

I think Metricbeat is not really what we are looking for. What we want is more "APM style". What I can see now in APM is what happens and for how long, when I request something to my application. So, we would like to know what happens (the same as before), but how much memory/CPU is required by every part of what happens when I request something to my application.  
Perhaps the application stats that Andrew mentions will give us this information?

---

<div class="post-metadata">

**Author:** ![beniwohli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/beniwohli/32/21256_2.png) [@beniwohli](https://discuss.elastic.co/u/beniwohli)\
**Post date:** [March 4, 2018, 2:43am UTC](https://discuss.elastic.co/t/monitoring-the-memory-use-of-our-application/121516/5 "2018-03-04T02:43:27Z")

</div>

Hi Cristina

While this is currently not possible, we do plan to add a feature to our agents, including the Python agent, to send custom metrics (as Andrew pointed out). This could potentially include things like allocations per request, or memory used per request, e.g. using something like [`memory_profiler`](https://pypi.python.org/pypi/memory_profiler). I haven't tested yet how much overhead it would incur to collect this kind of data though.

Unfortunately, I can't give you a time line of when this feature will be available, as it is still in early planning stages.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 24, 2018, 10:43pm UTC](https://discuss.elastic.co/t/monitoring-the-memory-use-of-our-application/121516/6 "2018-03-24T22:43:36Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
