Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-XX:ParallelGCThreads=N #22245

Closed
KeithTt opened this issue Dec 17, 2016 · 12 comments
Closed

-XX:ParallelGCThreads=N #22245

KeithTt opened this issue Dec 17, 2016 · 12 comments

Comments

@KeithTt
Copy link

KeithTt commented Dec 17, 2016

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

OS: CENTOS7.2

openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b15)
OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)

failed to start elasticsearch service...

@jasontedor
Copy link
Member

Some OpenJDK package maintainers (the RedHat line for sure) decided to start shipping their OpenJDK packages with -XX:+AssumeMP enabled by default. Frankly I think that this is a mistake, but that is what leads to the message that you're seeing here. You can disable this by starting the JVM with -XX:-AssumeMP (either add it to ES_JAVA_OPTS, or add it to jvm.options if you're on Elasticsearch 5.x (please include the version in future issues)).

@antboll
Copy link

antboll commented Jan 15, 2018

Hi,
I got the same Problem with Elasticsearch 5.x and centOS. Unfortunately I`m not very familiar to Linux. Which Command do I have to add into jvm.options to get the Service startet?

@KeithTt
Copy link
Author

KeithTt commented Jan 15, 2018

There is a file named jvm.options at /etc/elasticsearch/jvm.options, just add -XX:+AssumeMP to this file.

@flyinghawker
Copy link

I encounter same issue again and try to follow the idea @KeithTt
but not /etc/elasticsearch/jvm.options, elasticsearch-6.3.2/config/jvm.options instead,
adding -XX:+AssumeMP. Error still exsits.

centos_7_04_64_20G

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

@jasontedor
Copy link
Member

@flyinghawker You want -XX:-AssumeMP, not -XX:+AssumeMP.

@flyinghawker
Copy link

@jasontedor Thanks for the tricky detail notice. And setting -Xms?? and -Xmx?? also matters for me because my testing server RAM is only 1G, have to reduce to be lower than the free part of it. Thanks.

@SaiDesabathina
Copy link

How do I add -XX:+AssumeMP if I am using a Docker. Where should I search for files

@jasontedor
Copy link
Member

@SaiDesabathina I am happy to try to help but first I have some questions:

  • Are you using the official Elastic Docker container?
  • If so, which version of the container are you using?
  • What leads you to believe that you need this flag in your Docker container?

@SaiDesabathina
Copy link

@jasontedor Thanks for coming forward to help. I will explain my problem clearly. It should answer your questions. I downloaded elastic search (6.5.0), kibana (6.5.0) and logstash (6.5.0) images from Elastic website. I was successful in launching elastic search and kibana containers and following this I was trying to link logstash with elastic search. I am doing by following a youtube tutorial. To link logstash and elastic search I ran the following command:

docker run -h logstash --name logstash_a --link elasticsearch_1:elasticsearch -it
--rm -v "SPwD":/config-dir logstash:6.5.0 -f /config-dir/logstash.config

This came up with the following error:

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memory.

An error report file with more information is saved as:

/usr/share/logstash/hs_err_pid1.log

Could you please help me in launching logstash container and linking it with elastic search. Do you have any tutorial that I can use to learn.

Regards
Sai

@jasontedor
Copy link
Member

jasontedor commented Nov 18, 2018

I still can not tell if you’re using the official Elastic Docker images or not. It appears not, but I would prefer to not assume. Ultimately your problem is not related to -XX:-AssumeMP. Your problem is that you have insufficient memory. The JVM is trying to reserve 1 GB of heap and you do not have that available, that is what the log message is telling you. We have elastic/stack-docker for help orchestrating a full Elastic Stack via Docker containers. After you have addressed the fact that you have insufficient memory to start the containers that you’re trying to start, I suggest that you look there for ideas on orchestrating a full Elastic Stack via Docker. Finally, we have gotten off track from what this issue is about: -XX:-AssumeMP. I would ask that if you have further questions that you please use the forums. We reserve GitHub for verified bug reports and feature requests.

@WilburXu
Copy link

I encounter same issue again and try to follow the idea @KeithTt
but not /etc/elasticsearch/jvm.options, elasticsearch-6.3.2/config/jvm.options instead,
adding -XX:+AssumeMP. Error still exsits.

centos_7_04_64_20G

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

thanks!

@tvernum
Copy link
Contributor

tvernum commented Jun 27, 2019

@WilburXu You want -XX:-AssumeMP which turns off this option, (not +AssumeMP which turns it on).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants