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

[Bug] Benchmark java17 version exception #8898

Open
3 tasks done
hakusai22 opened this issue Nov 7, 2024 · 4 comments
Open
3 tasks done

[Bug] Benchmark java17 version exception #8898

hakusai22 opened this issue Nov 7, 2024 · 4 comments

Comments

@hakusai22
Copy link
Contributor

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

linux

RocketMQ version

rocketmq-all-5.2.0-bin-release/benchmark

JDK Version

java version "17.0.11" 2024-04-16 LTS
Java(TM) SE Runtime Environment (build 17.0.11+7-LTS-207)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.11+7-LTS-207, mixed mode, sharing)

Describe the Bug

  • The jvm parameters in the stress test runclass.sh are outdated. I use the java17 version and an exception occurs
benchmark]# Unrecognized VM option 'PermSize=128m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Steps to Reproduce

sh producer.sh -h

What Did You Expect to See?

success

What Did You See Instead?

error

Additional Context

No response

@hakusai22 hakusai22 changed the title [Bug] Bug title [Bug] Benchmark java17 version exception Nov 7, 2024
@hexueyuan
Copy link

You can manually modify benchmark’s startup script benchmark/runclass.sh.

In your case, you should change '-XX:PermSize=128m -XX:MaxPermSize=320m' to '-XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m'.

The PermSize option was used in Java 7 and earlier to set the initial size of the permanent generation space. However, starting from Java 8, this option was replaced by Metaspace.

@hakusai22
Copy link
Contributor Author

You can manually modify benchmark’s startup script benchmark/runclass.sh.

In your case, you should change '-XX:PermSize=128m -XX:MaxPermSize=320m' to '-XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m'.

The PermSize option was used in Java 7 and earlier to set the initial size of the permanent generation space. However, starting from Java 8, this option was replaced by Metaspace.

yes, After I modified the jvm parameters, it ran successfully

JAVA_OPT="${JAVA_OPT} -server -Xms1g -Xmx1g -Xmn256m "
JAVA_OPT="${JAVA_OPT} -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=70"
JAVA_OPT="${JAVA_OPT} -verbose:gc -Xlog:gc*:file=${GC_LOG_DIR}/rmq_run_class_gc_%p_%t.log:time,uptime,level,tags -XX:+PrintGCDetails"
JAVA_OPT="${JAVA_OPT} -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:+PerfDisableSharedMem"
JAVA_OPT="${JAVA_OPT} -cp ${CLASSPATH}"

@hakusai22
Copy link
Contributor Author

Is it possible to select appropriate parameters according to the java version? Java8 as the dividing line or abandon the original jvm parameters?

@hexueyuan
Copy link

Is it possible to select appropriate parameters according to the java version? Java8 as the dividing line or abandon the original jvm parameters?

The fix has been submitted to the develop branch, by adding an 'IgnoreUnrecognizedVMOptions' parameter, JVM parameters that are not recognized in higher versions are ignored, not perfect but useful.

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

2 participants