Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine optimal thread stack size?

Actually, two sizes: initially committed and total reserved.

Do you use static or dynamic analysis? Which tools? Which techniques?

like image 869
Constantin Avatar asked Nov 05 '22 23:11

Constantin


1 Answers

One technique is to paint your stack in main or the threads main with a known value and then on cleanup do a sweep from the stack limit until your known value is no longer found.

Your stack end will be defined as a symbol, generate a .map file to determine the stack limits and their symbol names.

It is discussed here: How to determine maximum stack usage?

like image 160
JeffV Avatar answered Nov 15 '22 11:11

JeffV