Garbage collection is weird

I'm just new to the project, where they asked me to investigate why the servers (applications) are acting strange. After rebooting, they are incredibly fast (response time 150 ms), but when they work for about 2 days, they become slow.

The memory and processor go up and will not fall until the application restarts.

Thus, they start the Tomcat server (hybris), which has the following command line flags: -XX: ConcGCThreads = 1 -XX: G1HeapRegionSize = 4194304 -XX: GCLogFileSize = 786432 -XX: InitialHeapSize = 12884901X88 -XX: + ManagementServer -XX: + ManagementServer MaxGCPauseMillis = 200 -XX: MaxHeapSize = 12884901888 -XX: NewRatio = 4 -XX: NumberOfGCLogFiles = 10 -XX: -OmitStackTraceInFastThrow -XX: ParallelGCThreads = 4 -XX: + ParallelRefProcEnabledGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX: + PrintGCTimeStamps -XX: + PrintTenuringDistribution -XX: ReservedCodeCacheSize = 134217728 -XX: ThreadStackSize = 1024 -XX: + UseCodeCacheFlushing -XX: + UseCompressedClassPointers -XX: + UseCompressedOops -XX: + UseXGGC + -XGGC + -XGGC + -XGGC +

In the figure below you can see the CPU and memory usage before and after the reboot. The application server has been under heavy load for several hours ...

CPU and memory usage

Using heap heaps and eds

Using the old heap of the old generation

Garbage processor load time

The application server itself is a quad-core processor with 16 GB of RAM.

Screenshots from a full run between two restarts:

CPU and memory usage

Using heap and poison and bush

Using heaps of the old generation

Garbage Collection Time

+4
source share
1 answer

Your application has a memory leak.

(GC), . , , GC, . , , , .

TomCat, Servlets ( , Spring) .

+3

Source: https://habr.com/ru/post/1692868/


All Articles