You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "hansonhe (Jira)" <ji...@apache.org> on 2022/12/28 03:38:00 UTC

[jira] [Commented] (HIVE-24650) hiveserver2 memory usage is extremely high, GC unable to recycle

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

hansonhe commented on HIVE-24650:
---------------------------------

I have the same problem on my production environment hive-3.1.2. Memory usage is occupied high all the time,Even the service is stuck.

(1)jstat -gc \{hs2-pid}

 S0C    S1C    S0U    S1U      EC       EU        OC         OU       MC     MU    CCSC   CCSU   YGC     YGCT    FGC    FGCT     GCT   
 0.0    0.0    0.0    0.0   32768.0    0.0    67076096.0 67067900.3 202496.0 184741.9  0.0    0.0     7475 1686.253  142  5875.588 7561.841

(2) jmap -heap \{hs2-pid}

Heap Configuration:
   MinHeapFreeRatio         = 40
   MaxHeapFreeRatio         = 70
   MaxHeapSize              = 68719476736 (65536.0MB)
   NewSize                  = 1363144 (1.2999954223632812MB)
   MaxNewSize               = 22900899840 (21840.0MB)
   OldSize                  = 5452592 (5.1999969482421875MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 17592186044415 MB
   G1HeapRegionSize         = 16777216 (16.0MB)

Heap Usage:
G1 Heap:
   regions  = 4096
   capacity = 68719476736 (65536.0MB)
   used     = 68669211960 (65488.06377410889MB)
   free     = 50264776 (47.93622589111328MB)
   99.92685512406752% used
G1 Young Generation:
Eden Space:
   regions  = 0
   capacity = 33554432 (32.0MB)
   used     = 0 (0.0MB)
   free     = 33554432 (32.0MB)
   0.0% used
Survivor Space:
   regions  = 0
   capacity = 0 (0.0MB)
   used     = 0 (0.0MB)
   free     = 0 (0.0MB)
   0.0% used
G1 Old Generation:
   regions  = 2
   capacity = 68685922304 (65504.0MB)
   used     = 68669211960 (65488.06377410889MB)
   free     = 16710344 (15.936225891113281MB)
   99.97567136985357% used

> hiveserver2 memory usage is extremely high, GC unable to recycle
> ----------------------------------------------------------------
>
>                 Key: HIVE-24650
>                 URL: https://issues.apache.org/jira/browse/HIVE-24650
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>    Affects Versions: 3.1.0
>         Environment: hive3.1.0
>            Reporter: zhaojk
>            Priority: Major
>         Attachments: 1.png, 2.png, 3.png
>
>
> HDP's HiveServer2 is using 80GB of memory (HEAP is configured with 74GB), and when the memory is full, there will be frequent Full GC, and then the memory cannot be recycled, resulting in a service exception.Analyze memory usage.
> GC config:
> export HADOOP_OPTS="$HADOOP_OPTS -Xloggc:\{{hive_log_dir}}/hiveserver2-gc-%t.log -XX:ConcGCThreads=30 -XX:ParallelGCThreads=30 -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:+UseStringDeduplication -XX:MaxGCPauseMillis=1000 -XX:InitiatingHeapOccupancyPercent=40 -XX:G1ReservePercent=15 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCCause -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/hive/hs2_heapdump.hprof -Dhive.log.dir=\{{hive_log_dir}} -Dhive.log.file=hiveserver2.log
> The details at
> [https://blog.csdn.net/Small_codeing/article/details/112601226]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)