Is there a way to know the value of maximum stack size consumed?
There isn’t a straightforward way to do this, however, there is a way using HP OpenView GlancePlus. GlancePlus has a function that reports the memory utilization for the memory mapped regions. First, select the process you want to monitor, then select Process Memory Regions. Isolate the regions allocated for the individual threads by looking for regions whose VSS value matches the value currently defined for -Xss. Once found, look at the values of the RSS for these regions and you can get a picture of what each thread is consuming. If you don’t have too many threads, you should be able to find out quickly the largest thread stack utilization. You could possibly write a script to process this information.