While recently searching the discussion forum, I read a post from member Dougmacewen909, who asked for advice on increasing the number of stack pages (SPs) that Windows uses. Before I explain how to do this, though, let me explain why you might need to.
Normally, stack pages aren’t something that you would have to adjust. However, sometimes it’s possible for Windows 9x/Me to encounter a stack overflow. If you’ve worked with DOS, you might recall that many older programs required a command such as STACKS=9,256 in the Config.sys file. The stacks that I’m talking about aren’t related to this command. Instead, I’m talking about the 32-bit stacks used exclusively for Windows applications.
Stack overflow error
When Windows experiences a stack overflow, it’s because of a bad device driver. Device drivers are allowed 4 KB of stack space, which translates into one stack page. If a driver exceeds this 4-KB limit, a stack overflow occurs. To prevent a stack overflow from bringing down the system, Windows sets up some spare stack pages. When a stack overflow occurs, Windows takes the overflow data and sends it to one of these spare stack pages. Then, Windows reclaims the temporary stack so that it can be used in another stack overflow.
Most of the time, this method of dealing with stack pages and device drivers works well. However, it is possible for multiple overflows to occur simultaneously or for a single overflow to be too big for Windows to handle. When this happens, Windows will typically display the following error message:
“There are no spare stack pages. It may be necessary to increase the setting of ‘MinSPs’ in System.ini to prevent possible stack faults. There are currently nnn SPs allocated.
“Terminating thread due to stack overflow problem. A vxd consumed too much stack space. Increase setting of MinSPs in System.ini or remove recently installed vxd’s. There are currently nnn SPs allocated. Hit any key to proceed.”
The resolution to this problem is actually fairly simple: Enter the SYSEDIT command at the Run prompt. This will launch the System Configuration Editor. Select the System.ini file from the editor’s Windows menu, as shown in Figure A.
Figure A |
![]() |
I’ve added the MinSPs=4 command to this Windows 98 workstation’s System.ini file. |
Next, look through the System.ini file to see if a section named [386Enh] exists. If it does, add the command MinSPs=4 to this section. This command is case-sensitive. If no [386Enh] section exists, then you must create it and then add the MinSps=4 command directly beneath it.
If you are using Windows Me, then the System.ini file won’t be displayed through the System Configuration Editor. Instead, you’ll have to use the Search For Files And Folders command on the Start | Search menu to locate the System.ini file before you can edit it.
For more information on Windows stack pages and resolving stack page errors, check out Microsoft Knowledge Base article 149083.