# Control ram usage

**URL:** <https://discuss.elastic.co/t/control-ram-usage/35387>\
**Category:** Elasticsearch\
**Created:** [November 24, 2015, 7:05am UTC](https://discuss.elastic.co/t/control-ram-usage/35387 "2015-11-24T07:05:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RR\_PHOTOSOFT](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@RR\_PHOTOSOFT](https://discuss.elastic.co/u/RR_PHOTOSOFT)\
**Post date:** [November 24, 2015, 7:05am UTC](https://discuss.elastic.co/t/control-ram-usage/35387/1 "2015-11-24T07:05:12Z")

</div>

Hi,  
I have an elasticsearch cluster with just one node and 1 shard on that node. I am performing bulk inserts @ 10k documents per bulk. Everything goes fine, but after a while I see that nearly 40 Gb of RAM has been used. When I started the node I just assigned it -Xmx4G -Xms4G. My server has crashed thrice, and I have no idea how to cap the memory being used. top reveals that the 'java' process is eating up all the memory. Any help is appreciated.  
RRPhotosoft.

---

<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:** [November 24, 2015, 7:07am UTC](https://discuss.elastic.co/t/control-ram-usage/35387/2 "2015-11-24T07:07:30Z")

</div>

That's the OS caching things, not ES.

If ES is crashing then it may be because it needs more heap

---

<div class="post-metadata">

**Author:** ![RR\_PHOTOSOFT](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@RR\_PHOTOSOFT](https://discuss.elastic.co/u/RR_PHOTOSOFT)\
**Post date:** [November 24, 2015, 7:17am UTC](https://discuss.elastic.co/t/control-ram-usage/35387/3 "2015-11-24T07:17:17Z")

</div>

Hi warkolm,  
How do I limit how much space the OS is using for caching? I'm new to java, so sorry for the newbie questions.  
Regards,Rrphotosoft

---

<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:** [November 25, 2015, 6:54am UTC](https://discuss.elastic.co/t/control-ram-usage/35387/4 "2015-11-25T06:54:47Z")

</div>

That's not something in java, it's an OS level thing and you will need to dig into the docs for your OS to find out.

---

<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, 11:36pm UTC](https://discuss.elastic.co/t/control-ram-usage/35387/5 "2017-07-05T23:36:05Z")

</div>


