# Is there any limit to the size of single doc being indexed?

**URL:** https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247
**Category:** Elasticsearch
**Created:** [June 19, 2016, 9:45pm UTC](https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247 "2016-06-19T21:45:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![michele\_crudele](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@michele\_crudele](https://discuss.elastic.co/u/michele_crudele)
#### Post date: [June 19, 2016, 9:45pm UTC](https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247/1 "2016-06-19T21:45:20Z")

</div>

I'm getting several exceptions like the one below in bulk indexing.

```auto
u'error': {u'caused_by': {u'reason': u'Java heap space', u'type': u'out_of_memory_error'}, u'reason': u'failed to parse', u'type': u'mapper_parsing_exception'}

```

I'm indexing documents with an array field with a big number of elements (may be 1000 - 10000 order of magnitude). Each element is a small json object. These documents have a big size: some of them are about 3MB.  
I take care of not exceeding the payload limit of the bulk indexing, so I suspect the typology and size of the documents I'm indexing can be the root cause of the exceptions.  
Is there any limit on the size of a single document that can be ingested? If not, is there any configuration parameter that I can tune to fix the problem?  
I'm running a single node elasticsearch, with default configuration.  
Thanks in advance.

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [June 19, 2016, 10:25pm UTC](https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247/2 "2016-06-19T22:25:34Z")

</div>

You can raise the es\_heap\_size. 3mb is quite large for a document but  
should be fine. It might be worth looking at the stats APIs to see if you  
are spending heap on something like field data.  
michele\_crudele [https://discuss.elastic.co/users/michele\_crudele](https://discuss.elastic.co/users/michele_crudele)  
June 19

I'm getting several exceptions like the one below in bulk indexing.

u'error': {u'caused\_by': {u'reason': u'Java heap space', u'type':  
u'out\_of\_memory\_error'}, u'reason': u'failed to parse', u'type':  
u'mapper\_parsing\_exception'}

I'm indexing documents with an array field with a big number of elements  
(may be 1000 - 10000 order of magnitude). Each element is a small json  
object. These documents have a big size: some of them are about 3MB.  
I take care of not exceeding the payload limit of the bulk indexing, so I  
suspect the typology and size of the documents I'm indexing can be the root  
cause of the exceptions.  
Is there any limit on the size of a single document that can be ingested?  
If not, is there any configuration parameter that I can tune to fix the  
problem?  
I'm running a single node elasticsearch, with default configuration.  
Thanks in advance.

Visit Topic  
[https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247/1](https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247/1)  
or reply to this email to respond

To stop receiving notifications for this particular topic, click here  
[https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247/unsubscribe](https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247/unsubscribe).  
To unsubscribe from these emails, change your user preferences  
[https://discuss.elastic.co/my/preferences](https://discuss.elastic.co/my/preferences)

---

<div class="post-metadata">

### Author: ![michele\_crudele](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@michele\_crudele](https://discuss.elastic.co/u/michele_crudele)
#### Post date: [June 20, 2016, 1:34pm UTC](https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247/3 "2016-06-20T13:34:00Z")

</div>

Thanks Nik,

just checked my ES\_HEAP\_SIZE is set to 12G, so should be fine, right?  
About stats, I'm a bit confused, there are a lots I can query. My I ask you a couple of example commands that you would run to get information about the specific problem of "documents too large"? Thanks again.

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [June 20, 2016, 1:51pm UTC](https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247/4 "2016-06-20T13:51:39Z")

</div>

I'm fairly sure the problem _isn't_ too large documents. Though, if you have a stacktrace from the logs for the OOM that'd help.

It'd be nice to see a graph of your heap usage over time. It should look like a saw tooth, rising slowly and dropping quickly. The _time_ between each quick drop is the important thing, not the actual number. Marvel can do that with point and click. The [nodes stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html) API is the place to get that information. You can also look in the `indices` stat for the field cache size.

OTOH if you somehow do push a multi-GB sized bulk I wouldn't be surprised to see an error like this.

---

<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: [July 5, 2017, 10:42pm UTC](https://discuss.elastic.co/t/is-there-any-limit-to-the-size-of-single-doc-being-indexed/53247/5 "2017-07-05T22:42:13Z")

</div>


