`Hello Team,
We have our java application which was migrated from dropwizard to Quarkus. We have not changed the style of coding meaning still the code is blocking. After migration when we are deploying it to EC2 we are getting Out of memory issue.
Our application is dockerized and deployed on EC2. Docker reserved memory for our application is of 1024 MB and heap as -Xms950m -Xmx950m.
We took the Heap dump of the application and found out that classes like below were retaining a lot of Heap memory. This classes were highlighted in the MAT analyzer tool from eclipse to retain large amount of heap memory.
io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueue
io.netty.buffer.PoolThreadCache$SubPageMemoryRegionCache
io.netty.buffer.PoolThreadCache$MemoryRegionCache[]
io.netty.buffer.PoolThreadCache
Here are the things we tried.
1.
-Dio.netty.allocator.maxThreadLocalCharArrayCache=0
-Dio.netty.allocator.maxThreadLocalDirectByteBufCache=0
-Dio.netty.allocator.maxThreadLocalHeapByteBufCache=0
We observed that out of memory was not happening as we have disabled caching altogether by setting the above parameters. Also our application Memory utilization was functioning properly.
- Rather than disabling the Netty Caching totally as we did in the first option, we have tried to set couple of properties like below but again ran into out of memory.
-Dio.netty.allocator.maxCachedBufferCapacity=32768
-Dio.netty.allocator.cacheTrimInterval=8192
-Dio.netty.allocator.numHeapArenas=4
-Dio.netty.allocator.numDirectArenas=4
-Dio.netty.allocator.tinyCacheSize=512
-Dio.netty.allocator.smallCacheSize=256
-Dio.netty.allocator.normalCacheSize=64
Could you please suggest the above parameters values that we should set for our application having docker memory of 1024 MB and heap of -Xms950m -Xmx950m. Also please suggest if we should try something else.
Also please let us know if we will have some impact if go by the first option ?
Point to Note : Our Application has heavy traffic all the time.
Thanks a lot in advance for any suggestions that we will be receiving. `
user25661917 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.