Thursday, September 17, 2009

Too Many Forms Open…. error

This is a common one I see from a lot of high volume customers. When certain people open a lot of forms consecutively, they will see an error that says "Too many forms are currently open, close some forms and try again" and will crash their client session. This happens due to a restriction of GDI objects that are allowed to be consumed for a given process (10000 objects by default).

ABOUT GDI OBJECTS: This value is controlled at the operating system level and is set in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota. There is a theoretical limit of 65,536 GDI handles per session. However, the maximum number of GDI handles that can be opened per session is usually lower, since it is affected by available memory. This value can be set to a number between 256 and 65,536. GDI handles are a kernel memory paged pool resource. If you run out of paged pool memory, Windows will start to do some 'quirky' things and become very unpredictable. You are able to tune the GDI limits but be very cautious when doing it.

HOW TO ADDRESS THE AX ISSUE: Due to an issue in Dynamics AX 2009 RTM and SP1, the GDI handles leak in the system which causes the number of GDI objects to rise. This eventually leads to the 10000 (or whatever your value may be) to be reached. This issue is addressed through the KB Article hotfix 960849. It can be found through either PartnerSource or CustomerSource. If the current situation does not allow for a hotfix to be installed, the following are 2 options that can be taken as a workaround:

  1. Restart the Client AX session and reopen it. This resets the GDI handles.
  2. Make sure the users encountering the issue have the 'Filter By Grid On By Default' unchecked in their user options (see Figure 1 below). This will disable the object leak.

Figure 1 - User options screen with 'Filter By Grid On By Default' check box displayed