I detected an issue for a Win32 application that uses TBB version 4.
Win32 API function 'CreateThread' fails with system error code 8 when a 'tbb_thread' object creates
a thread and 2GB of memory is reserved\\committed for the Win32 application.
Here are some technical details:
Error Code: 8
Decription: Not enough storage is available to process this command
Define : ERROR_NOT_ENOUGH_MEMORY
IDE: Visual Studio 2005
I setHeap( Reserve\\Commit ) and Stack ( Reserve\\Commit )values to 536,870,912 bytes in [ Project Properties -> Linker -> System ]:
Heap Reserve Size: 536870912
Heap Commit Size: 536870912
Stack Reserve Size : 536870912
Stack Commit Size: 536870912
In total 2GB of memory is reserved\\committed for the Win32 application.I need this for a multiplication oftwo large matrices.
Note 1: This is NOT a problem with TBB. This is some issue, possibly known, with the Win32 API function 'CreateThread'.
Note 2: An MSDN's article about 'Address Windowing Extensions' states:
...The address space is usually split so that 2 GB of address space is directly accessible to the application...
It is off the subject, but here are some details...
In case of multiplication of two matrices with sizes greater than 2048 x 2048:
Strassen's Stack-based algorithm uses "enormous" amount of memory from the Stack
Strassen's Heap-based algorithm uses "enormous" amount of memory from the Heap
I know this.32-bit Windowshas to bestarted with the /3GB option. Here is a link to Microsoft's Technet
The /3GB switch is supported only on the following operating systems:
Windows 2000 Advanced Server
Windows 2000 Datacenter Server
Windows Server 2003 Standard Edition
Windows Server 2003 Enterprise Edition
Windows Server 2003 Datacenter Edition
Unfortunately, Windows XP is not on the list.
Heap Reserve Size: 1069547520
Heap Commit Size: 1069547520
Stack Reserve Size: 4194304
Stack Commit Size: 4194304
1069547520 = ( 2^31 - ( 2^22 * 2 ) ) / 2
4194304 = 2^22
Here is some information on aStress-Testing of TBB with theseHeap ( Reserve\Commit ) and Stack ( Reserve\Commit ) values:
Debug Configuration : up to 233 threads could be created
ReleaseConfiguration: up to 242 threads could be created