# SystemMemoryOutOfException While Indexing Documents as attachments

**URL:** <https://discuss.elastic.co/t/systemmemoryoutofexception-while-indexing-documents-as-attachments/51119>\
**Category:** Elasticsearch\
**Created:** [May 27, 2016, 6:58am UTC](https://discuss.elastic.co/t/systemmemoryoutofexception-while-indexing-documents-as-attachments/51119 "2016-05-27T06:58:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![ASN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asn/32/10535_2.png) [@ASN](https://discuss.elastic.co/u/ASN)\
**Post date:** [May 27, 2016, 9:03am UTC](https://discuss.elastic.co/t/systemmemoryoutofexception-while-indexing-documents-as-attachments/51119/5 "2016-05-27T09:03:11Z")

</div>

No. I just created the variable thats it.  
something like ` var response = client.IndexMany(list,"indexname")`.  
It is throwing an error here everytime.  
Sometimes it work perfectly, sometimes it wont. Confused . Dont know if it is my code problem or elasticsearch problem or as u said .NET problem(😋).

Adding to this problem, I have another problem.

> [@FileSystemwatcher with Documents Indexing as Attachments (c#,Nest)](https://discuss.elastic.co/t/filesystemwatcher-with-documents-indexing-as-attachments-c-nest/51105):
>
> Hi All, I'm trying to reproduce a console application which watches a folder and any new additions of documents to the folder are to be Indexed to ES . It is working fine If I move/add 3-4 documents at a time and able to index. But if I move around 30 documents at a time, It is not indexing all the documents, instead indexing only one. But If I run the code with break points , then even 30 documents are also getting indexed. Can some one help me in solving this. static void OnCreated(object…

So this week, I'm completely stuck with these issues. 😔

---

_[View the full topic](https://discuss.elastic.co/t/systemmemoryoutofexception-while-indexing-documents-as-attachments/51119)._
