# ES6.2.2 cannot initialize, allocate physical memory very slow

**URL:** <https://discuss.elastic.co/t/es6-2-2-cannot-initialize-allocate-physical-memory-very-slow/123502>\
**Category:** Elasticsearch\
**Created:** [March 12, 2018, 8:41am UTC](https://discuss.elastic.co/t/es6-2-2-cannot-initialize-allocate-physical-memory-very-slow/123502 "2018-03-12T08:41:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jinleileiking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinleileiking/32/28666_2.png) [@jinleileiking](https://discuss.elastic.co/u/jinleileiking)\
**Post date:** [March 12, 2018, 8:41am UTC](https://discuss.elastic.co/t/es6-2-2-cannot-initialize-allocate-physical-memory-very-slow/123502/1 "2018-03-12T08:41:23Z")

</div>

**Describe the feature** :

**Elasticsearch version** (`bin/elasticsearch --version`): 6.2.2

**Plugins installed** : [no plugin]

**JVM version** (`java -version`): 1.8.0

**OS version** (`uname -a` if on a Unix-like system): inux [tjwq01-ibu-video002158.tjwq01.ksyun.com](http://tjwq01-ibu-video002158.tjwq01.ksyun.com) 2.6.32-431.el6.x86\_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86\_64

500g mem. Total. 2 es (2.1.2) use 31 \* 2 g mem

```auto
work@tjwq01-ibu-video002158.tjwq01.ksyun.com ~/es6_2/node1/elasticsearch-6.2.2]$ free -g │ 27.43 0.00 13.06 0.75 0.00 58.76
             total used free shared buffers cached │
Mem: 504 121 382 0 0 35

```

**Description of the problem including expected versus actual behavior** : When start es. There will be one core to locate memory. My machine had 2 process already running (es 2.1.2 ) . When I ran the third es (6.2.2) . The es process allocate memroy very slowly ( when set xms = 21g, It cost 30min).

`When I comment jvm.options:`alwayspretouch`line. It also cannot work well`

> <https://github.com/elastic/elasticsearch/issues/21300>

**Steps to reproduce** :

Please include a _minimal_ but _complete_ recreation of the problem, including  
(e.g.) index creation, mappings, settings, query etc. The easier you make for  
us to reproduce it, the more likely that somebody will take the time to look at it.

1. hard to produce. I have 5 es machines. 3 allocating memory is fast. these 2 are slow. all the 5 nodes have 2 es already ran on them as data nodes(es 2.1.2)
2. 
3. 

**Provide logs (if relevant)**:

when try jstack es62 process. the es62 will core dump.

top:

![es](https://user-images.githubusercontent.com/93968/37270567-3f415cc2-260a-11e8-91ae-f79f6452be0b.png)

---

<div class="post-metadata">

**Author:** ![jinleileiking](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinleileiking/32/28666_2.png) [@jinleileiking](https://discuss.elastic.co/u/jinleileiking)\
**Post date:** [March 12, 2018, 9:05am UTC](https://discuss.elastic.co/t/es6-2-2-cannot-initialize-allocate-physical-memory-very-slow/123502/2 "2018-03-12T09:05:55Z")

</div>

Thread 25 (Thread 0x7fd2e0523700 (LWP 2352)):  
#0 0x00007fd2df4265b6 in VirtualSpace::expand\_by(unsigned long, bool) () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#1 0x00007fd2df42711e in VirtualSpace::initialize(ReservedSpace, unsigned long) () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#2 0x00007fd2def6b9f1 in CardGeneration::CardGeneration(ReservedSpace, unsigned long, int, GenRemSet\*) () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#3 0x00007fd2dee493fb in ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration(ReservedSpace, unsigned long, int, CardTableRS\*, bool, FreeBlockDictionary::DictionaryChoice) () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#4 0x00007fd2def6caa2 in GenerationSpec::init(ReservedSpace, int, GenRemSet\*) () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#5 0x00007fd2def5b74e in GenCollectedHeap::initialize() () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#6 0x00007fd2df3f3aab in Universe::initialize\_heap() () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#7 0x00007fd2df3f3e1e in universe\_init() () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#8 0x00007fd2defad635 in init\_globals() () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#9 0x00007fd2df3d802e in Threads::create\_vm(JavaVMInitArgs\*, bool\*) () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#10 0x00007fd2df041244 in JNI\_CreateJavaVM () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/jre/lib/amd64/server/libjvm.so  
#11 0x00007fd2dfee545e in JavaMain () from /data/work/es6.2/node1/es6/jdk1.8.0\_45/bin/../lib/amd64/jli/libjli.so  
#12 0x00007fd2e00fbaa1 in start\_thread () from /lib64/libpthread.so.0  
#13 0x00007fd2dfa2ebcd in clone () from /lib64/libc.so.6

---

<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:** [April 9, 2018, 9:06am UTC](https://discuss.elastic.co/t/es6-2-2-cannot-initialize-allocate-physical-memory-very-slow/123502/3 "2018-04-09T09:06:10Z")

</div>

Closed on April 9, 2018, 9:06am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
