I have several processes running on RHEL 6.3, but for some reason they exceed the size of the thread stack.
For example, the Java process is set to the -Xss256k stack size at runtime at startup, and the C ++ process is set to a 1 MB thread stack size using pthread_attr_setstacksize () in the actual code.
However, for some reason, these processes do not adhere to these restrictions, and I'm not sure why.
For example, when I run
pmap -x <pid>
for a C ++ and Java process, I see hundreds of "anon" threads for each (which I confirmed are internal workflows created by each of these processes), but they have a dedicated value of 64 MB, not the limits set above:
00007fa4fc000000 168 40 40 rw--- [ anon ] 00007fa4fc02a000 65368 0 0 ----- [ anon ] 00007fa500000000 168 40 40 rw--- [ anon ] 00007fa50002a000 65368 0 0 ----- [ anon ] 00007fa504000000 168 40 40 rw--- [ anon ] 00007fa50402a000 65368 0 0 ----- [ anon ] 00007fa508000000 168 40 40 rw--- [ anon ] 00007fa50802a000 65368 0 0 ----- [ anon ] 00007fa50c000000 168 40 40 rw--- [ anon ] 00007fa50c02a000 65368 0 0 ----- [ anon ] 00007fa510000000 168 40 40 rw--- [ anon ] 00007fa51002a000 65368 0 0 ----- [ anon ] 00007fa514000000 168 40 40 rw--- [ anon ] 00007fa51402a000 65368 0 0 ----- [ anon ] 00007fa518000000 168 40 40 rw--- [ anon ] ...
But when I run the following from the above process with all 64MB threads of 'anon'
cat /proc/<pid>/limits | grep stack Max stack size 1048576 1048576 bytes
it shows a maximum thread stack size of 1 MB, so it’s a bit confused as to what is going on here. In addition, the script that invokes these programs sets "ulimit -s 1024".
It should be noted that this only happens when using very high-performance machines (for example, 48 GB of RAM, 24 processor cores). The problem does not appear on less powerful machines (for example, 4 GB of RAM, 2 CPU cores).
Any help in understanding what is going on here would be greatly appreciated.