Xwiki after upgrade 16.10.1 slow and no response

After I upgraded xwiki to the latest version 16.10.1. I did notice the CPU usage goes 100%.

I am not the programmer. I do not know how codes work. Is it related to the CPU or RAM setting??
Because I also found that

JAVA_OPTS=“-Djava.awt.headless=true -Xmx2048m”
With this settings, It can work longer time than -Xmx1024m

Leave it running a bit and it’ll probably go down. At the first start there can be migrations and solr reindexing.

See https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Performances/#HSizing and https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Performances/#HMemory

Sorry, the high CPU usage lasts several days already.

CPU goes down only when I block access to the xwiki.

Then you should take a thread dump to see what’s using the CPU.

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1105 tomcat 20 0 5734632 3.297g 203628 S 13.7 42.4 2:56.36 GC Thread#0
1204 tomcat 20 0 5734632 3.297g 203628 S 12.1 42.4 2:57.23 GC Thread#1
1138 tomcat 20 0 5734632 3.297g 203628 R 4.2 42.4 6:53.56 C2 CompilerThre
1107 tomcat 20 0 5734632 3.297g 203628 R 3.6 42.4 3:29.43 G1 Conc#0
1840 tomcat 20 0 5734632 3.297g 203628 S 3.6 42.4 0:36.90 http-nio-8080-e
1977 tomcat 20 0 5734632 3.297g 203628 R 3.6 42.4 1:35.58 http-nio-8080-e
2018 tomcat 20 0 5734632 3.297g 203628 R 3.6 42.4 1:08.21 http-nio-8080-e
1780 tomcat 20 0 5734632 3.297g 203628 R 3.3 42.4 0:26.43 http-nio-8080-e
1781 tomcat 20 0 5734632 3.297g 203628 R 3.3 42.4 2:57.17 http-nio-8080-e
1842 tomcat 20 0 5734632 3.297g 203628 R 3.3 42.4 2:40.33 http-nio-8080-e
1846 tomcat 20 0 5734632 3.297g 203628 R 3.3 42.4 2:58.41 http-nio-8080-e
3590 tomcat 20 0 5734632 3.297g 203628 R 3.3 42.4 2:08.42 http-nio-8080-e
3683 tomcat 20 0 5734632 3.297g 203628 R 3.3 42.4 1:38.48 http-nio-8080-e
415 root 19 -1 323084 122580 121912 S 2.9 1.5 0:32.90 systemd-journal
1848 tomcat 20 0 5734632 3.297g 203628 R 2.9 42.4 3:22.32 http-nio-8080-e
2273 tomcat 20 0 5734632 3.297g 203628 R 2.9 42.4 1:09.41 http-nio-8080-e
2275 tomcat 20 0 5734632 3.297g 203628 R 2.9 42.4 3:30.15 http-nio-8080-e
3685 tomcat 20 0 5734632 3.297g 203628 R 2.9 42.4 2:09.60 http-nio-8080-e
4320 tomcat 20 0 5734632 3.297g 203628 R 2.9 42.4 1:39.98 http-nio-8080-e
4332 tomcat 20 0 5734632 3.297g 203628 R 2.9 42.4 0:40.76 http-nio-8080-e
4351 tomcat 20 0 5734632 3.297g 203628 R 2.9 42.4 0:38.91 http-nio-8080-e
5042 tomcat 20 0 5734632 3.297g 203628 R 2.9 42.4 0:30.72 http-nio-8080-e
5094 tomcat 20 0 5734632 3.297g 203628 R 2.9 42.4 0:26.80 http-nio-8080-e
7126 tomcat 20 0 5734632 3.297g 203628 S 2.9 42.4 0:01.93 http-nio-8080-e
1699 tomcat 20 0 5734632 3.297g 203628 R 2.6 42.4 2:59.42 http-nio-8080-e
1851 tomcat 20 0 5734632 3.297g 203628 S 2.6 42.4 0:28.39 http-nio-8080-e
3577 tomcat 20 0 5734632 3.297g 203628 R 2.6 42.4 0:49.18 http-nio-8080-e
3589 tomcat 20 0 5734632 3.297g 203628 R 2.6 42.4 1:32.78 http-nio-8080-e
5098 tomcat 20 0 5734632 3.297g 203628 S 2.6 42.4 0:29.15 http-nio-8080-e
5100 tomcat 20 0 5734632 3.297g 203628 R 2.6 42.4 0:30.11 http-nio-8080-e
6435 tomcat 20 0 5734632 3.297g 203628 R 2.6 42.4 0:05.27 http-nio-8080-e

It seems the wrong settings with GC Thread

see https://www.baeldung.com/java-thread-dump

C2 CompilerThre takes very high CPU
Is there any way to fix it???