Even when a MuleSoft application is idle, the memory being used seems to steadily increase to a high level. Then the memory is released and the pattern starts again. This causes a saw-tooth pattern on the Memory graphs.
The MuleSoft application runs some background processes that can consume heap memory, even when the application is idle. These processes include system health checks and other monitoring-related tasks.
As a result, it is normal to observe a sawtooth pattern in heap usage, where memory usage gradually increases and is then reduced during garbage collection cycles. This behavior is expected in Java applications, even when there is little or no application traffic.
Because it is not efficient to constantly clear memory in a mostly idle application, the heap may gradually grow over time until a significant portion of memory is used. This growth is typically due to memory accumulated by background processes, which is expected behavior.
Eventually, the Garbage Collector will run and reclaim the unused memory, reducing the heap usage again.
If the application is using a lot of memory much more quickly, the Garbage Collection becomes more aggressive. That is, the memory will clear more regularly. The Garbage Collection doesn't automatically kick in when it reaches a specific memory level, but rather calculates how quickly the memory is being used and judges it based on that.
If a large payload or sudden intensive Flow kicks in while the memory is already at a high level, the Garbage Collector will simply kick in before the JVM runs out of memory. The strain on the CPU will be negligible also, so you will see no performance loss. The only real worry would be if the payload being processed is too high, even for normal memory levels.
If the sawtooth pattern shows the memory low point as being around the same level after each Garbage Collection, then there should be no further action to take. If you see that the Garbage Collection task does not clear all the memory back to expected levels, then you should start looking at the individual application components for a potential memory leak.
Please also see the article Java JVM memory allocation pattern explained for more information.
How to enable Garbage Collection logs for performance tuning
001119048

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.