As we donot set any stack size for QThread and it looks like it runs out of default stack size limit during long running operation. Hence would like to measure the cumulative stack variables used in a thread so as to set stack size of QThread accordingly.

It is possible to measure stack usage, but there is no fun in it. If you're willing to use private QtQml API you can call stackProperties() as declared in [1] to find an approximation of the stack boundaries. You can then compare that with currentStackPointer(), conveniently defined in the same file, to get your stack usage.

Mind that it's not really exact. See [2] for the implementation.

[1] https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/qml/memory/qv4stacklimits_p.h

[2] https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/qml/memory/qv4stacklimits.cpp

best regards,
Ulf Hermann
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to