0
votes

I am trying to run elasticsearch node for Magento 2.4 , I have a shared host with very limited permissions , I can't use any sudo or git or any command just low user level I have to fix this issue.

Here is the error : java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached

Full output

-bash-4.2$ cd elasticsearch-7.9.2 -bash-4.2$ ./bin/elasticsearch -d -bash-4.2$ [29.133s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached. [29.133s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached. fatal error in thread [elasticsearch[nl-srv-web333.main-hosting.eu][clusterApplierService#updateTask][T#1]], exiting java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached at java.base/java.lang.Thread.start0(Native Method) at java.base/java.lang.Thread.start(Thread.java:801) at java.base/java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:939) at java.base/java.util.concurrent.ThreadPoolExecutor.processWorkerExit(ThreadPoolExecutor.java:1007) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)

-bash-4.2$

I need to fix this issue without any root or sudo commands please because I have tried every thing on the internet and nothing is working . Thanks

1

1 Answers

0
votes

After a lot of tries and googled this issue I have found that the configs of my Elastic Standalone ( Since I do not have root access I am just downloaded and ran it) was wrong heap size (OutOfMemory) issue was due to the default settings for the following arguments in the file /elasticsearch/config/jvm.options

-Xms1g

-Xmx1g

which means 1 Giga minimum size.

where were exceed my memory limit I have changed the values to

-Xms500m

-Xmx500m

which means 500 mega instead of 1 Giga Then save the file and run again elasticsearch as deamon and worked fine!

cd Elasticsearch-7.9.2

./bin/elasticsearch -d

Hope this help someone stuck with alot of mis-guided for sudo, apt, yum installs which are not available for non user access in a shared host.