How to determine optimal thread stack size?

后端 未结 1 1520
不知归路
不知归路 2021-01-13 08:09

Actually, two sizes: initially committed and total reserved.

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

1条回答
  •  时光说笑
    2021-01-13 08:51

    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?

    0 讨论(0)
提交回复
热议问题