# Out Of Memory When Store Index In Memory

**URL:** https://discuss.elastic.co/t/out-of-memory-when-store-index-in-memory/10118
**Category:** Elasticsearch
**Created:** [December 19, 2012, 8:40am UTC](https://discuss.elastic.co/t/out-of-memory-when-store-index-in-memory/10118 "2012-12-19T08:40:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zkidkid](https://avatars.discourse-cdn.com/v4/letter/z/fbc32d/32.png) [@zkidkid](https://discuss.elastic.co/u/zkidkid)
#### Post date: [December 19, 2012, 8:40am UTC](https://discuss.elastic.co/t/out-of-memory-when-store-index-in-memory/10118/1 "2012-12-19T08:40:13Z")

</div>

Hi All,

To increase the suggestion I has changed store type to memory as setting  
bellow:

cluster.name: es\_zautosuggest\_dev  
node.name: "es\_zasuggest\_124"  
node.master: true  
node.data: true  
index.number\_of\_shards: 5  
index.number\_of\_replicas: 0  
index.store.type: memory  
index.gateway.type: none  
gateway.type: fs  
gateway.fs.location: /zserver/java-projects/dev\_suggest/data

I have 3 servers like this, #1 I store default, #2 & #3 I store "memory"

The problem is the memory increase too fast when I indexing 4M data for  
testing.  
The data contains two field:  
name (\< 10 word, \<50 character)  
data ( \< 50 word, \< 300 character)

My server 1 has 40Gb Ram.

I allocate it for 20Gb Ram by setting ES\_HEAP\_SIZE

set.default.ES\_HEAP\_SIZE=20480

wrapper.java.initmemory=%ES\_HEAP\_SIZE%

wrapper.java.maxmemory=%ES\_HEAP\_SIZE%

For first 2M data, the memory is ok.  
But for later 2M data, the memory going too fast.

I check in head plugin and the size is:

My\_Index:  
size: 606.1mb (1.7gb)  
docs: 2356911 (2356912)

I think 1.7Gb is the actually size of data after analysis. so with 20Gb  
allocated my server should ok.

Is anything in ES I have missed ?

P/S: Is there a way to set a specify index to store in memory and other is  
store in disk ?

Thanks In Advance.

--

---

<div class="post-metadata">

### Author: ![Marcin\_Dojwa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcin_dojwa/32/2307_2.png) [@Marcin\_Dojwa](https://discuss.elastic.co/u/Marcin_Dojwa)
#### Post date: [December 19, 2012, 9:42am UTC](https://discuss.elastic.co/t/out-of-memory-when-store-index-in-memory/10118/2 "2012-12-19T09:42:32Z")

</div>

Hi,

You can set index.store.type to the specified index. Check 'Index Settings'  
section here:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

It can surely be set at index creation time, but I am not sure it can be  
changed while index exists.

Best regards.  
Marcin Dojwa

2012/12/19 kidkid [zkidkid@gmail.com](mailto:zkidkid@gmail.com)

> index.store.type

--

---

<div class="post-metadata">

### Author: ![zkidkid](https://avatars.discourse-cdn.com/v4/letter/z/fbc32d/32.png) [@zkidkid](https://discuss.elastic.co/u/zkidkid)
#### Post date: [December 20, 2012, 9:06am UTC](https://discuss.elastic.co/t/out-of-memory-when-store-index-in-memory/10118/3 "2012-12-20T09:06:17Z")

</div>

Thanks Marcin Dojwa.

I still have this type of problem. I would try to analysis it later.  
I found some other also have problem with store in memory.

Hope kimchi will take a look in it.

On Wednesday, December 19, 2012 4:42:32 PM UTC+7, Marcin Dojwa wrote:

> Hi,
> 
> You can set index.store.type to the specified index. Check 'Index  
> Settings' section here:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/setup/configuration.html)
> 
> It can surely be set at index creation time, but I am not sure it can be  
> changed while index exists.
> 
> Best regards.  
> Marcin Dojwa
> 
> 2012/12/19 kidkid \<[zki...@gmail.com](mailto:zki...@gmail.com) \<javascript:\>\>
> 
> > index.store.type

--

---

<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 6, 2017, 2:59am UTC](https://discuss.elastic.co/t/out-of-memory-when-store-index-in-memory/10118/4 "2017-07-06T02:59:10Z")

</div>


