Quarkus Rest service Heap memory is growing without any request - quarkus

I have a Quarkus REST API, Which used hibernate Panache to connect to Database. Installed feature while running application is
Installed features: [agroal, cdi, hibernate-orm, hibernate-orm-panache, mutiny, narayana-jta, resteasy, resteasy-jackson, security, smallrye-context-propagation, smallrye-openapi, swagger-ui]
There is no request I have placed so far, but my heap memory is getting increased to 500mb in 30 minutes. Is it normal? After sometime GC executed and memory became free. Again heap started growing.

Related

Spring boot API request limit issue

I have developed a microservice using Spring Boot and deployed it as a docker container and when doing performance testing the service I see that the maximum number of threads that created to the service is 20 at any point in time even though the number of calls made is much higher. I have even set the max thread to 4000 and also set Max connection to 10000 along with all db configuration and server has 24 core and 64 gb ram still no improvement Are there any limitations with respect to number of calls that can be made to a microservice developed using Spring Boot or is the issue is with docker container? Or is this normal?

spring boot microservice consumes a lot of memory in container deployed in ecs aws

I have a microservice in spring boot which is deployed in a container with corretto 11 in ECS.
The component is deployed with 512MB and its initial consumption is close to 50%, as traffic increases, memory increases and is never freed, to the point where the task in ECS crashes and a new one must be started.
The following image shows the behavior of memory over time, as the traffic increases the times in which the tasks in ECS are up are less.
Memory Consumption in a Container on AWS ECS
Spring Boot Version: 2.4.3
JDK Image: Corretto 11
UPDATE:
I did a profiler and analysis of the heapdump and I see a high consumption in spring libraries.
Heapdump analysis with VisualVM
According to the screenshot, the problem seems to be in DefaultListableBeanFactory objects.
Please, check your code and make sure that you don't instantiate spring beans for every request. If so, you need to autowire them only once, statically.
For example, check the following solution:
Memory leak in jboss service due to DefaultListableBeanFactory objects
Here is the explanation, on why there can be Memory leak in serializable bean factory management:
https://github.com/spring-projects/spring-framework/issues/12159?focusedCommentId=57240&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-57240
P.S. I don't think that there is a bug in Spring framework itself, but if so, then please, upgrade Spring Boot to the latest version. Maybe your version contains some bug, which causes memory leak.
See details in this reported issue:
https://github.com/spring-projects/spring-framework/issues/25619

System Memory Not getting Freed up in Ec2 instance even after java process /docker container is stopped

We have tomcat in docker inside an ec2 instance. A java application which uses SQS, Spring boot runs in tomcat. As the load increases we see that the system memory increases slowly and have to restart the ec2-instance to clear the memory.
During all this time, The heap remains stable.
we were able to slowdown the memory growth with a chnage to make JAXB context singleton.
Not sure what is using the System memory and how to clear it or prevent it. Does spring boot and it litener threads taking this memory ?
Thanks in advance.

Can we use Managed Coherence Servers (MCS) feature with single Weblogic cluster to deploy application and coherence GAR?

We have a Weblogic cluster with set of managed servers where we have already deployed our enterprise application which heavily involved in database transactions. Recently we have migrated to Weblogic 12c and we have a proposal in pipeline to use Oracle Coherence to enable a caching layer so that we can improve application performance.
After doing a research we found that Managed Coherence Servers (MCS) feature in WLS 12c supported by creating additional storage enabled cluster which we can be used to deploy the GAR.
However increasing memeory in the production set up in costly to create a new cluster hence before proposing it I want to know whether Oracle Coherence feature can be used without creating a new cluster but without compromising MCS features?
You can create Oracle Coherence caches in the same cluster where application EAR is deployed. Follow this link on how to create the caches Pack GAR with Application EAR
But it always make sense to have your caching layer separate from your application layer. As caches also use the Heap Memory to store/cache objects. When your application and the cache are deployed in the same server (same JVM), they will have to share the heap space among themselves. And as far as i know, there is no clear way to define separate zones in heap memory for different application running on same JVM.
Hence there is a high probability for any of the application to consume more heap and make the other to starve and ultimately causing Out of Memory exceptions. Plus capacity planning for Coherence caches will also be a nightmare as you have to consider the memory consumed by the application too.

Huge org.springframework.boot.loader.LaunchedURLClassLoader memory usage

Over time my unused running my Spring Boot v1.3.2 application gradually increases memory consumption until it eventually falls over. By unused I mean no client requested are being served apart from the regular ping of the /health end point.
According to the Eclipse Memory Analyser, org.springframework.boot.loader.LaunchedURLClassLoader is taking up a massive 920MB.
It appears as though Spring Boot is continually loading classes
Any ideas what's going on?
EDIT
Looks like it's Spring Cloud Consul that's causing the issue:
Appears to be a memory leak in Spring Cloud Consul. Raised issue https://github.com/spring-cloud/spring-cloud-consul/issues/183

Resources