Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 1 | # Copyright © 2018 Amdocs, AT&T, Bell Canada |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | ## JVM configuration |
| 16 | |
| 17 | ################################################################ |
| 18 | ## IMPORTANT: JVM heap size |
| 19 | ################################################################ |
| 20 | ## |
| 21 | ## You should always set the min and max JVM heap |
| 22 | ## size to the same value. For example, to set |
| 23 | ## the heap to 4 GB, set: |
| 24 | ## |
| 25 | ## -Xms4g |
| 26 | ## -Xmx4g |
| 27 | ## |
| 28 | ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html |
| 29 | ## for more information |
| 30 | ## |
| 31 | ################################################################ |
| 32 | |
| 33 | # Xms represents the initial size of total heap space |
| 34 | # Xmx represents the maximum size of total heap space |
| 35 | |
| 36 | -Xms1g |
| 37 | -Xmx1g |
| 38 | |
| 39 | ################################################################ |
| 40 | ## Expert settings |
| 41 | ################################################################ |
| 42 | ## |
| 43 | ## All settings below this section are considered |
| 44 | ## expert settings. Don't tamper with them unless |
| 45 | ## you understand what you are doing |
| 46 | ## |
| 47 | ################################################################ |
| 48 | |
| 49 | ## GC configuration |
| 50 | -XX:+UseConcMarkSweepGC |
| 51 | -XX:CMSInitiatingOccupancyFraction=75 |
| 52 | -XX:+UseCMSInitiatingOccupancyOnly |
| 53 | |
| 54 | ## optimizations |
| 55 | |
| 56 | # pre-touch memory pages used by the JVM during initialization |
| 57 | -XX:+AlwaysPreTouch |
| 58 | |
| 59 | ## basic |
| 60 | |
| 61 | # force the server VM |
| 62 | -server |
| 63 | |
| 64 | # explicitly set the stack size |
| 65 | -Xss1m |
| 66 | |
| 67 | # set to headless, just in case |
| 68 | -Djava.awt.headless=true |
| 69 | |
| 70 | # ensure UTF-8 encoding by default (e.g. filenames) |
| 71 | -Dfile.encoding=UTF-8 |
| 72 | |
| 73 | # use our provided JNA always versus the system one |
| 74 | -Djna.nosys=true |
| 75 | |
| 76 | # turn off a JDK optimization that throws away stack traces for common |
| 77 | # exceptions because stack traces are important for debugging |
| 78 | -XX:-OmitStackTraceInFastThrow |
| 79 | |
| 80 | # flags to configure Netty |
| 81 | -Dio.netty.noUnsafe=true |
| 82 | -Dio.netty.noKeySetOptimization=true |
| 83 | -Dio.netty.recycler.maxCapacityPerThread=0 |
| 84 | |
| 85 | # log4j 2 |
| 86 | -Dlog4j.shutdownHookEnabled=false |
| 87 | -Dlog4j2.disable.jmx=true |
| 88 | |
| 89 | ## heap dumps |
| 90 | |
| 91 | # generate a heap dump when an allocation from the Java heap fails |
| 92 | # heap dumps are created in the working directory of the JVM |
| 93 | -XX:+HeapDumpOnOutOfMemoryError |
| 94 | |
| 95 | # specify an alternative path for heap dumps |
| 96 | # ensure the directory exists and has sufficient space |
| 97 | #-XX:HeapDumpPath=/heap/dump/path |
| 98 | |
| 99 | ## GC logging |
| 100 | |
| 101 | #-XX:+PrintGCDetails |
| 102 | #-XX:+PrintGCTimeStamps |
| 103 | #-XX:+PrintGCDateStamps |
| 104 | #-XX:+PrintClassHistogram |
| 105 | #-XX:+PrintTenuringDistribution |
| 106 | #-XX:+PrintGCApplicationStoppedTime |
| 107 | |
| 108 | # log GC status to a file with time stamps |
| 109 | # ensure the directory exists |
| 110 | #-Xloggc:${loggc} |
| 111 | |
| 112 | # By default, the GC log file will not rotate. |
| 113 | # By uncommenting the lines below, the GC log file |
| 114 | # will be rotated every 128MB at most 32 times. |
| 115 | #-XX:+UseGCLogFileRotation |
| 116 | #-XX:NumberOfGCLogFiles=32 |
| 117 | #-XX:GCLogFileSize=128M |