[ 
https://issues.apache.org/jira/browse/CASSANDRA-15839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153193#comment-17153193
 ] 

Jeremy Hanna edited comment on CASSANDRA-15839 at 7/8/20, 2:49 AM:
-------------------------------------------------------------------

This is the code that *should* detect whether or not G1 is enabled.  However 
you can either enable or disable it with {{+UseG1GC}} or {{-UseG1GC}} which are 
both matched by that {{grep}}.  I have to admit I've never seen anyone in 
practice explicitly disable G1.
{code:sh}
echo $JVM_OPTS | grep -q UseG1GC
USING_G1=$?
{code}
That also affects whether we calculate heap sizes automatically or whether we 
fail out when we don't set the heap and new size in pairs:
{code:sh}
# only calculate the size if it's not set manually
if [ "x$MAX_HEAP_SIZE" = "x" ] && [ "x$HEAP_NEWSIZE" = "x" -o $USING_G1 -eq 0 
]; then
    calculate_heap_sizes
elif [ "x$MAX_HEAP_SIZE" = "x" ] ||  [ "x$HEAP_NEWSIZE" = "x" -a $USING_G1 -ne 
0 ]; then
    echo "please set or unset MAX_HEAP_SIZE and HEAP_NEWSIZE in pairs when 
using CMS GC (see cassandra-env.sh)"
    exit 1
fi
{code}
Created CASSANDRA-15931 to address this.


was (Author: jeromatron):
This is the code that *should* detect whether or not G1 is enabled.  However 
since you can either enable or disable it with that string {{+UseG1GC}} or 
{{-UseG1GC}}.  I have to admit I've never seen anyone in practice explicitly 
disable G1.
{code:sh}
echo $JVM_OPTS | grep -q UseG1GC
USING_G1=$?
{code}
That also affects whether we calculate heap sizes automatically or whether we 
fail out when we don't set the heap and new size in pairs:
{code:sh}
# only calculate the size if it's not set manually
if [ "x$MAX_HEAP_SIZE" = "x" ] && [ "x$HEAP_NEWSIZE" = "x" -o $USING_G1 -eq 0 
]; then
    calculate_heap_sizes
elif [ "x$MAX_HEAP_SIZE" = "x" ] ||  [ "x$HEAP_NEWSIZE" = "x" -a $USING_G1 -ne 
0 ]; then
    echo "please set or unset MAX_HEAP_SIZE and HEAP_NEWSIZE in pairs when 
using CMS GC (see cassandra-env.sh)"
    exit 1
fi
{code}
Created CASSANDRA-15931 to address this.

> Warn or fail to start server when G1 is used and Xmn is set
> -----------------------------------------------------------
>
>                 Key: CASSANDRA-15839
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15839
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Local/Startup and Shutdown
>            Reporter: Jeremy Hanna
>            Assignee: Anthony Grasso
>            Priority: Normal
>             Fix For: 4.0, 4.0-alpha5
>
>
> In jvm.options, we currently have a comment above where Xmn is set that says 
> that you shouldn't set Xmn with G1 GC.  That isn't enough - we should either 
> warn in the logs or fail startup when they are set together.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to