Java

如何檢查我的 ElasticSearch 程序是否使用壓縮 oops?

  • February 2, 2017

我想知道是否需要調整目前執行的 ElasticSearch 集群。如何檢查正在執行的 HotSpot 程序是否使用壓縮 oops?

您可以使用集群節點資訊 API 並檢查using_compressed_ordinary_object_pointers欄位中的jvm欄位。

例如

curl -XGET 'http://localhost:9200/_nodes'

或者

curl -XGET 'http://localhost:9200/_nodes/nodeId1'

或更具體:

curl -XGET 'http://localhost:9200/_nodes/nodeId1,nodeId2/jvm?pretty'

回复

...
"jvm" : {
       "pid" : 14520,
       "version" : "1.8.0_121",
       "vm_name" : "OpenJDK 64-Bit Server VM",
       "vm_version" : "25.121-b13",
       "vm_vendor" : "Oracle Corporation",
       "start_time_in_millis" : 1485817021479,
       "mem" : {
         "heap_init_in_bytes" : 5368709120,
         "heap_max_in_bytes" : 5333843968,
         "non_heap_init_in_bytes" : 2555904,
         "non_heap_max_in_bytes" : 0,
         "direct_max_in_bytes" : 5333843968
       },
       "gc_collectors" : [ "ParNew", "ConcurrentMarkSweep" ],
       "memory_pools" : [ "Code Cache", "Metaspace", "Compressed Class Space", "Par Eden Space", "Par Survivor Space", "CMS Old Gen" ],
       "using_compressed_ordinary_object_pointers" : "true"
     },

...

引用自:https://serverfault.com/questions/830262