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

[Dubbo-1330] Fix Support MetaspaceSize and MaxMetaspaceSize vm args in java8+ #1347

Merged
merged 5 commits into from
Jun 11, 2018
Merged

[Dubbo-1330] Fix Support MetaspaceSize and MaxMetaspaceSize vm args in java8+ #1347

merged 5 commits into from
Jun 11, 2018

Conversation

web1992
Copy link
Contributor

@web1992 web1992 commented Feb 8, 2018

What is the purpose of the change

see #1330

  • Support MetaspaceSize and MaxMetaspaceSize in java8+

Brief changelog

In linux and windows I use shell or batch to get java version by java -fullversion, you can see it in commit.

In the commit ,you can find I use JAVA_8_VERSION="180" to compare java vesion. The reasion is that java version naming rule change in java 9.

java -fullversion output example

  • in jdk1.7 -> java full version "1.7.0_79-b15"
  • in jdk1.7 -> java full version "1.8.0_152-b16"
  • in jdk9 -> java full version "9.0.4+11"

I find many dos symbol in start.sh, if you run start.sh in linux, it may be a problem. I use dos2unix cmd to format the file.

Verifying this change

Test result in windows

  • jdk9
    image
  • jdk1.8
    image
  • jdk1.7
    image

@codecov-io
Copy link

Codecov Report

Merging #1347 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1347      +/-   ##
==========================================
- Coverage   32.39%   32.37%   -0.02%     
==========================================
  Files         691      691              
  Lines       34535    34535              
  Branches     6811     6811              
==========================================
- Hits        11186    11181       -5     
- Misses      21416    21421       +5     
  Partials     1933     1933
Impacted Files Coverage Δ
...om/alibaba/dubbo/rpc/filter/ActiveLimitFilter.java 77.77% <0%> (-11.12%) ⬇️
...libaba/com/caucho/hessian/util/IdentityIntMap.java 25% <0%> (-5.96%) ⬇️
...ba/dubbo/remoting/transport/netty/NettyServer.java 67.85% <0%> (-3.58%) ⬇️
.../dubbo/rpc/protocol/dubbo/filter/FutureFilter.java 54.54% <0%> (-2.03%) ⬇️
...mon/serialize/support/dubbo/GenericDataOutput.java 65.61% <0%> (ø) ⬆️
...mmon/serialize/support/dubbo/GenericDataInput.java 58.3% <0%> (ø) ⬆️
...alibaba/dubbo/rpc/protocol/thrift/ThriftCodec.java 4.03% <0%> (+0.86%) ⬆️
...baba/dubbo/remoting/transport/mina/MinaClient.java 59.42% <0%> (+1.44%) ⬆️
...a/dubbo/remoting/transport/netty/NettyChannel.java 66.25% <0%> (+5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d129f10...cdb6fd7. Read the comment docs.

@@ -58,11 +60,18 @@ if [ "$1" = "jmx" ]; then
JAVA_JMX_OPTS=" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
fi
JAVA_MEM_OPTS=""
#set jvm args by different java version
JAVA_VERSION=`java -version 2>&1 | awk -F[\"\.] -v OFS=. 'NR==1{print $3}'`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JAVA_VERSION=java -version 2>&1 | grep -i 'java version' | awk -F[\"\.] -v OFS=. 'NR==1{print $3}'

@beiwei30
Copy link
Member

beiwei30 commented Feb 9, 2018

@web1992, I put some comments on your code change, pls. check.

@web1992 web1992 changed the title [Dubbo-1330] Fix Support MetaspaceSize and MaxMetaspaceSize vm args in java8+ [Dubbo-1330] Fix Support MetaspaceSize and MaxMetaspaceSize vm args in java8+ Feb 9, 2018
@chickenlj chickenlj added the status/waiting-for-feedback Need reporters to triage label Feb 9, 2018
@web1992
Copy link
Contributor Author

web1992 commented Feb 11, 2018

@beiwei30 Sorry, what you mean? I don't understand, show I put some comments in start.sh ?

@beiwei30
Copy link
Member

@web1992 Your code for parsing java version is not robust, in fact it doesn't work in my environment :p. A better way to parse java version is JAVA_VERSION=java -version 2>&1 | grep -i 'java version' | awk -F[".] -v OFS=. 'NR==1{print $3}'`

@web1992
Copy link
Contributor Author

web1992 commented Feb 11, 2018

@beiwei30 What is you java version and os ? Mac ,Linux or Windws ?
I test in java 9 on linux ,the output is 0

java -version 2>&1 | awk -F[\"\.] -v OFS=. 'NR==1{print $3}' 
# output is 0

image

@diecui1202
Copy link

@web1992 your shell is not work on my mac os. you can use this way:

    JAVA_VERSION=`$JAVA_HOME"/bin/java" -version 2>&1` || { echo $JAVA_HOME"/bin/java -version failed"; exit 1; }
    JAVA_VERSION_MAJOR=${JAVA_VERSION:16:1}
    if [ "$JAVA_VERSION_MAJOR" -ge 8 ]; then
        ......

It works on mac and linux.

@beiwei30 beiwei30 merged commit a138004 into apache:master Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/waiting-for-feedback Need reporters to triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants