jvm.options 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ## JVM configuration
  2. ################################################################
  3. ## IMPORTANT: JVM heap size
  4. ################################################################
  5. ##
  6. ## You should always set the min and max JVM heap
  7. ## size to the same value. For example, to set
  8. ## the heap to 4 GB, set:
  9. ##
  10. ## -Xms4g
  11. ## -Xmx4g
  12. ##
  13. ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
  14. ## for more information
  15. ##
  16. ################################################################
  17. # Xms represents the initial size of total heap space
  18. # Xmx represents the maximum size of total heap space
  19. -Xms2g
  20. -Xmx2g
  21. ################################################################
  22. ## Expert settings
  23. ################################################################
  24. ##
  25. ## All settings below this section are considered
  26. ## expert settings. Don't tamper with them unless
  27. ## you understand what you are doing
  28. ##
  29. ################################################################
  30. ## GC configuration
  31. -XX:+UseConcMarkSweepGC
  32. -XX:CMSInitiatingOccupancyFraction=75
  33. -XX:+UseCMSInitiatingOccupancyOnly
  34. ## optimizations
  35. # pre-touch memory pages used by the JVM during initialization
  36. -XX:+AlwaysPreTouch
  37. ## basic
  38. # force the server VM (remove on 32-bit client JVMs)
  39. -server
  40. # explicitly set the stack size (reduce to 320k on 32-bit client JVMs)
  41. -Xss1m
  42. # set to headless, just in case
  43. -Djava.awt.headless=true
  44. # ensure UTF-8 encoding by default (e.g. filenames)
  45. -Dfile.encoding=UTF-8
  46. # use our provided JNA always versus the system one
  47. -Djna.nosys=true
  48. # use old-style file permissions on JDK9
  49. -Djdk.io.permissionsUseCanonicalPath=true
  50. # flags to configure Netty
  51. -Dio.netty.noUnsafe=true
  52. -Dio.netty.noKeySetOptimization=true
  53. -Dio.netty.recycler.maxCapacityPerThread=0
  54. # log4j 2
  55. -Dlog4j.shutdownHookEnabled=false
  56. -Dlog4j2.disable.jmx=true
  57. -Dlog4j.skipJansi=true
  58. ## heap dumps
  59. # generate a heap dump when an allocation from the Java heap fails
  60. # heap dumps are created in the working directory of the JVM
  61. -XX:+HeapDumpOnOutOfMemoryError
  62. # specify an alternative path for heap dumps
  63. # ensure the directory exists and has sufficient space
  64. #-XX:HeapDumpPath=${heap.dump.path}
  65. ## GC logging
  66. #-XX:+PrintGCDetails
  67. #-XX:+PrintGCTimeStamps
  68. #-XX:+PrintGCDateStamps
  69. #-XX:+PrintClassHistogram
  70. #-XX:+PrintTenuringDistribution
  71. #-XX:+PrintGCApplicationStoppedTime
  72. # log GC status to a file with time stamps
  73. # ensure the directory exists
  74. #-Xloggc:${loggc}
  75. # By default, the GC log file will not rotate.
  76. # By uncommenting the lines below, the GC log file
  77. # will be rotated every 128MB at most 32 times.
  78. #-XX:+UseGCLogFileRotation
  79. #-XX:NumberOfGCLogFiles=32
  80. #-XX:GCLogFileSize=128M
  81. # Elasticsearch 5.0.0 will throw an exception on unquoted field names in JSON.
  82. # If documents were already indexed with unquoted fields in a previous version
  83. # of Elasticsearch, some operations may throw errors.
  84. #
  85. # WARNING: This option will be removed in Elasticsearch 6.0.0 and is provided
  86. # only for migration purposes.
  87. #-Delasticsearch.json.allow_unquoted_field_names=true