# Questions about memory usage

**URL:** <https://discuss.elastic.co/t/questions-about-memory-usage/4999>\
**Category:** Elasticsearch\
**Created:** [July 29, 2011, 2:12pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999 "2011-07-29T14:12:06Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diogo\_Figueiredo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diogo_figueiredo/32/3144_2.png) [@Diogo\_Figueiredo](https://discuss.elastic.co/u/Diogo_Figueiredo)\
**Post date:** [July 29, 2011, 2:12pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/1 "2011-07-29T14:12:06Z")

</div>

Hi,

I am using ElasticSearch for a few months in a project. The simplicity and  
power it has is.. really amazing.  
On this project we are using a VPS to host a normal LAMP stack +  
ElasticSearch.

The problem is the memory usage.  
Without anything the server is using: (cumulative values)  
Nothing: 28MB  
With MySQL: 159 MB  
With Apache: 216 MB  
With ES: 650~700MB

The thing is I'm only indexing around 10k documents. My config file (running  
as a service) is:

set.default.ES\_HOME=  
set.default.ES\_MIN\_MEM=32  
set.default.ES\_MAX\_MEM=64

htop screenshot: [http://imgur.com/kC3W9](http://imgur.com/kC3W9)

I've checked and the server is started with the correct memory  
configuration, but still after a couple of hours, 2-3 days the memory usage  
just goes over the top and the server crashes.  
So I need to be constantly restart the elastic search service.

I'm running a CentOS on a VPS with a limit of 1GB. Any more thing you would  
like to know ask please.  
Even tough this is nothing VERY serious right now, I'm worried that with  
traffic spike the server would crash/restart very quickly. Can you help me?

Thanks,  
Diogo

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 29, 2011, 2:36pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/2 "2011-07-29T14:36:53Z")

</div>

Which version of elasticsearch are you using?

On Fri, Jul 29, 2011 at 5:12 PM, Diogo Figueiredo [diogoepf@gmail.com](mailto:diogoepf@gmail.com)wrote:

> Hi,
> 
> I am using Elasticsearch for a few months in a project. The simplicity and  
> power it has is.. really amazing.  
> On this project we are using a VPS to host a normal LAMP stack +  
> Elasticsearch.
> 
> The problem is the memory usage.  
> Without anything the server is using: (cumulative values)  
> Nothing: 28MB  
> With MySQL: 159 MB  
> With Apache: 216 MB  
> With ES: 650~700MB
> 
> The thing is I'm only indexing around 10k documents. My config file  
> (running as a service) is:
> 
> set.default.ES\_HOME=  
> set.default.ES\_MIN\_MEM=32  
> set.default.ES\_MAX\_MEM=64
> 
> htop screenshot: [Imgur: The magic of the Internet](http://imgur.com/kC3W9)
> 
> I've checked and the server is started with the correct memory  
> configuration, but still after a couple of hours, 2-3 days the memory usage  
> just goes over the top and the server crashes.  
> So I need to be constantly restart the Elasticsearch service.
> 
> I'm running a CentOS on a VPS with a limit of 1GB. Any more thing you would  
> like to know ask please.  
> Even tough this is nothing VERY serious right now, I'm worried that with  
> traffic spike the server would crash/restart very quickly. Can you help me?
> 
> Thanks,  
> Diogo

---

<div class="post-metadata">

**Author:** ![Diogo\_Figueiredo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diogo_figueiredo/32/3144_2.png) [@Diogo\_Figueiredo](https://discuss.elastic.co/u/Diogo_Figueiredo)\
**Post date:** [July 29, 2011, 2:42pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/3 "2011-07-29T14:42:58Z")

</div>

Good question, how can I check the version?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [July 29, 2011, 3:10pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/4 "2011-07-29T15:10:16Z")

</div>

It prints the version in hte log when it starts up.

On Fri, Jul 29, 2011 at 5:42 PM, Diogo Figueiredo [diogoepf@gmail.com](mailto:diogoepf@gmail.com)wrote:

> Good question, how can I check the version?

---

<div class="post-metadata">

**Author:** ![Diogo\_Figueiredo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diogo_figueiredo/32/3144_2.png) [@Diogo\_Figueiredo](https://discuss.elastic.co/u/Diogo_Figueiredo)\
**Post date:** [July 29, 2011, 3:27pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/5 "2011-07-29T15:27:30Z")

</div>

0.16.0. Should I update it and then see what happens?  
To update its just replace the existing files and restart the service?

---

<div class="post-metadata">

**Author:** ![Diogo\_Figueiredo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diogo_figueiredo/32/3144_2.png) [@Diogo\_Figueiredo](https://discuss.elastic.co/u/Diogo_Figueiredo)\
**Post date:** [July 29, 2011, 3:51pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/6 "2011-07-29T15:51:24Z")

</div>

Updated to the latest version, updated the index, but still the huge memory  
footprint.

---

<div class="post-metadata">

**Author:** ![Diogo\_Figueiredo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diogo_figueiredo/32/3144_2.png) [@Diogo\_Figueiredo](https://discuss.elastic.co/u/Diogo_Figueiredo)\
**Post date:** [August 2, 2011, 6:50pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/7 "2011-08-02T18:50:07Z")

</div>

Do you have any idea?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 2, 2011, 6:53pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/8 "2011-08-02T18:53:06Z")

</div>

Whats the RES memory that you see for the process?

On Tue, Aug 2, 2011 at 9:50 PM, Diogo Figueiredo [diogoepf@gmail.com](mailto:diogoepf@gmail.com) wrote:

> Do you have any idea?

---

<div class="post-metadata">

**Author:** ![Diogo\_Figueiredo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diogo_figueiredo/32/3144_2.png) [@Diogo\_Figueiredo](https://discuss.elastic.co/u/Diogo_Figueiredo)\
**Post date:** [August 2, 2011, 7:03pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/9 "2011-08-02T19:03:11Z")

</div>

Normaly around 149MB. If I kill all processes and restart ES it will go to  
100MB (only ES and basic linux processes). But Virtual is around 400MB.

What do you think?

On Tue, Aug 2, 2011 at 8:53 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Whats the RES memory that you see for the process?
> 
> On Tue, Aug 2, 2011 at 9:50 PM, Diogo Figueiredo [diogoepf@gmail.com](mailto:diogoepf@gmail.com)wrote:
> 
> > Do you have any idea?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 2, 2011, 7:05pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/10 "2011-08-02T19:05:31Z")

</div>

Sounds sensible to me

On Tue, Aug 2, 2011 at 10:03 PM, Diogo Figueiredo [diogoepf@gmail.com](mailto:diogoepf@gmail.com)wrote:

> Normaly around 149MB. If I kill all processes and restart ES it will go to  
> 100MB (only ES and basic linux processes). But Virtual is around 400MB.
> 
> What do you think?
> 
> On Tue, Aug 2, 2011 at 8:53 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > Whats the RES memory that you see for the process?
> > 
> > On Tue, Aug 2, 2011 at 9:50 PM, Diogo Figueiredo [diogoepf@gmail.com](mailto:diogoepf@gmail.com)wrote:
> > 
> > > Do you have any idea?

---

<div class="post-metadata">

**Author:** ![Diogo\_Figueiredo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diogo_figueiredo/32/3144_2.png) [@Diogo\_Figueiredo](https://discuss.elastic.co/u/Diogo_Figueiredo)\
**Post date:** [August 2, 2011, 7:13pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/11 "2011-08-02T19:13:35Z")

</div>

I will look somewhere else then 😉 Thanks for the fast replies 🙂

On Tue, Aug 2, 2011 at 9:05 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Sounds sensible to me
> 
> On Tue, Aug 2, 2011 at 10:03 PM, Diogo Figueiredo [diogoepf@gmail.com](mailto:diogoepf@gmail.com)wrote:
> 
> > Normaly around 149MB. If I kill all processes and restart ES it will go to  
> > 100MB (only ES and basic linux processes). But Virtual is around 400MB.
> > 
> > What do you think?
> > 
> > On Tue, Aug 2, 2011 at 8:53 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > Whats the RES memory that you see for the process?
> > > 
> > > On Tue, Aug 2, 2011 at 9:50 PM, Diogo Figueiredo [diogoepf@gmail.com](mailto:diogoepf@gmail.com)wrote:
> > > 
> > > > Do you have any idea?

---

<div class="post-metadata">

**Author:** ![Diogo\_Figueiredo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diogo_figueiredo/32/3144_2.png) [@Diogo\_Figueiredo](https://discuss.elastic.co/u/Diogo_Figueiredo)\
**Post date:** [August 4, 2011, 11:15pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/12 "2011-08-04T23:15:42Z")

</div>

Getting back to this.. Even if my Max memory is 64MB today it reached to  
more than 300MB Res memory. Is that normal?  
Because I set it up to Max 64 MB so I would expect it not to cross that  
point..

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 6, 2011, 5:11pm UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/13 "2011-08-06T17:11:02Z")

</div>

When you set the max heap memory to 64mb, thats what it will control, its  
the heap memory the java process will have. It does not count memory  
associated with things like sockets, file handles and so on.

On Fri, Aug 5, 2011 at 2:15 AM, Diogo Figueiredo [diogoepf@gmail.com](mailto:diogoepf@gmail.com) wrote:

> Getting back to this.. Even if my Max memory is 64MB today it reached to  
> more than 300MB Res memory. Is that normal?  
> Because I set it up to Max 64 MB so I would expect it not to cross that  
> point..

---

<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, 3:58am UTC](https://discuss.elastic.co/t/questions-about-memory-usage/4999/14 "2017-07-06T03:58:03Z")

</div>


