# Memory usage of a specific document

**URL:** https://discuss.elastic.co/t/memory-usage-of-a-specific-document/86420
**Category:** Elasticsearch
**Created:** [May 19, 2017, 12:31pm UTC](https://discuss.elastic.co/t/memory-usage-of-a-specific-document/86420 "2017-05-19T12:31:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jaxoncreed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaxoncreed/32/8557_2.png) [@jaxoncreed](https://discuss.elastic.co/u/jaxoncreed)
#### Post date: [May 19, 2017, 12:31pm UTC](https://discuss.elastic.co/t/memory-usage-of-a-specific-document/86420/1 "2017-05-19T12:31:27Z")

</div>

Is there any way to determine the amount of memory a specific document will or is taking up? It doesn't need to be done in a query (as I don't think there is one). Would it be possible to write a function that takes in the JSON for a document, it's mapping, and returns memory usage? If so, how would that function work?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [May 20, 2017, 11:20pm UTC](https://discuss.elastic.co/t/memory-usage-of-a-specific-document/86420/2 "2017-05-20T23:20:22Z")

</div>

What sort of memory though - field data, global ordinals, doc values cached by OS, query/aggs?

Basically, it's complicated and I don't think there would be a single way of doing this. The explain API _may_ be able to cover this, but I think there'd be a lot of changes to do it.

---

<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: [June 17, 2017, 11:20pm UTC](https://discuss.elastic.co/t/memory-usage-of-a-specific-document/86420/3 "2017-06-17T23:20:57Z")

</div>

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