Article ID: 932909 - Last Review: April 24, 2007 - Revision: 1.1 By default, the maximum stack size of a thread that is created in a native IIS process is 256 KBSUMMARYBy default, the maximum stack size of a thread that is created by a native Microsoft Internet Information Services (IIS) process is 256 KB. For example, Inetinfo.exe, DLLHost.exe, or W3wp.exe creates a thread, the maximum stack size of the thread is 256 KB by default. You can also explicitly call the CreateThread function to specify the stack size of the thread. In Microsoft Windows 2000, if the Microsoft ASP.NET Worker Process (ASPNet_wp.exe) creates a thread, the maximum stack size of the thread is 1 MB. MORE INFORMATIONThe maximum stack size of a thread is not determined by an individual ISAPI, DLL, or ASP component that is running inside the process. The maximum stack size of a thread is configured by the executable file of the process. If you must have a large stack size, you can programmatically create a thread and then set the appropriate stack size. Alternatively, if the thread runs out of the maximum stack size, you must change the code in the application to use the stack correctly. The arguments and the local variables of a function are stored in the stack of the thread. If you declare a local variable that has a very large value, the stack is quickly exhausted. For example, the function in the following code example requires 400,000 bytes in the stack to store the array. To avoid using the stack, dynamically allocate the memory. For example, the function in the following code example dynamically allocates the memory. If a function is called recursively, the stack may be quickly exhausted. For example, a function requires 400,000 bytes in the stack if the following conditions are true:
For more information, visit the following MSDN Web site: http://msdn2.microsoft.com/en-us/library/ms686774.aspx
(http://msdn2.microsoft.com/en-us/library/ms686774.aspx)
| Article Translations
|
Back to the top
