From 9e646a3415cad13ec03ebe506216a3f13ae7ad5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 29 Mar 2021 18:34:11 +0200 Subject: [PATCH] [util] Override default thread stack reserve size. Some applications (Dragon Quest Builder 2 for instance) use an oversized default thread stack reserve size (2G in this case), which cause every DXVK thread to allocate as much memory, quickly exhausting system memory. --- src/util/thread.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/thread.h b/src/util/thread.h index 4fab9e75..80b6289f 100644 --- a/src/util/thread.h +++ b/src/util/thread.h @@ -40,8 +40,9 @@ namespace dxvk { // Reference for the thread function this->incRef(); - m_handle = ::CreateThread(nullptr, 0, - ThreadFn::threadProc, this, 0, nullptr); + m_handle = ::CreateThread(nullptr, 0x100000, + ThreadFn::threadProc, this, STACK_SIZE_PARAM_IS_A_RESERVATION, + nullptr); if (m_handle == nullptr) throw DxvkError("Failed to create thread");