We are using Apache Camel to pull the data from SQS and do some process and importing into the database.
Since we need more performance we are doing experiment with 4 application deployed in Apache Tomcat version 8 each have 12 routes pointing to respective 12 SQS Queue deployed in single server(64 GB RAM)
Each route has 500 threads and 750 Max Pool size. Totally for 4 applications we have totally 24000 Threads and 36000 Max Pool Size.
When ever we running test Tomcat stopped unexpectedly due to the following error message,
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f3395aef000, 12288, 0) failed; error='Cannot allocate memory' (errno=12) Java HotSpot(TM) 64-Bit Server VM warning: # Attempt to protect stack guard pages failed.# There is insufficient memory for the Java Runtime Environment to continue.
Native memory allocation (mmap) failed to map 12288 bytes for
committing reserved memory.
But while checking total RAM usage of server it is being only used about 16 to 18 GB.
So we reduced the each route Thread size to 250 and Max Pool Size to 500.Totally for 4 applications we have totally 12000 Threads and 24000 Max Pool Size. In this time application is working fine without any issues.
Heap Size in Tomcat : 40G
We are not sure why we are facing issue when we have more threads ?.Whether we need to change any configuration in tomcat to support more threads?
Can you please help us to resolve this issue?