An image in Altia Design is imported from an image file and it becomes a Raster object or Stencil object in Altia Design/Runtime or an image file is referenced dynamically using an Image object in Altia Design/Runtime. In any case, to render the image requires the use of a Windows GDI object.
There is one (1) GDI object used per image in an Altia design, but there are also GDI objects used to render dialogs (such as the Open File dialog) and windows (such as the Animation Editor, Stimulus Editor, Control Editor, Models View, etc.). The GDI objects used by dialogs and windows account for at most about 500 GDI objects at any specific time.
Windows (XP, Vista, 7, 8, 10, etc.) has a default limit of 10,000 GDI objects per process. If the Altia process runs out of GDI objects because there are so many images in a design (probably more than 9,500), the Altia process will exit unexpectedly or Windows will display a dialog saying the Altia process encountered a problem or unexpected error and needs to close. There is no easy way to recover when GDI objects are not available for rendering.
Running out of GDI objects can happen during these operations:
- When adding more images: More images are imported or Image objects are added to a design that already has many, many images.
- On .dsn or XML import: A .dsn design file or XML file containing more images is imported.
- On library .dsn open/copy: A .dsn design file containing more images is opened as a library from the Models View or when it is copied into Altia Design from the Models View.
- When panning: It can happen by panning in Altia Design or a Models View when the design has many, many images because this requires Altia to render more and more images (which requires more GDI objects).
- On a Validate Design: A .dsn design file opened in Altia Design has many Image objects not showing. The number of GDI objects used is relatively small to start (for example, up to 500) because a hidden Image object does not use a GDI object until it needs to load its image. If the Validate Design option is pressed from the Validator pane, many more GDI objects are needed because each Image object must load its image whether or not it is showing. This requires an additional GDI object per Image object.
- If Real-time Validation is enabled: On a .dsn design file opened in Altia Design has many Image objects not showing and Real-Time Validation is enabled. In this case, Real-Time Validation executes in the background to validate all objects in the design. As each Image object is encountered by the Validator, the associated image gets loaded. This requires an additional GDI object per Image object.
- On DeepScreen code generation for a design with many images: The DeepScreen code generator is a separate executable started by Altia Design. The DeepScreen code generator executable must load each image to generate the data for that image. This requires a GDI object per image.
If there is a GDI limit issue, this will show in the Windows Task Manager GDI objects column of the Processes tab (On Windows 10, the Details tab) for any Altia process currently executing. Possible Altia processes are:
- Altia Design 11 or 12 : altia.exe process
- Altia Design 8 / 9 / 10 : altiaengine.exe process.
- the "classic" Altia Design 7.0 or earlier : altia.exe process.
- the Altia Runtime altiart.exe process.
- the DeepScreen code generator altiagen.exe process.
If there is no GDI objects column showing in the Windows Task Manager, it can be added:
- On Windows XP/Vista/7/8: Change to the Windows Task Manager Processes tab, use the View->Select Columns... option to add a GDI Objects column.
- On Windows 10: Change to the Windows Task Manager Details tab, right-click on an existing column header (e.g., Name), choose Select columns to add a GDI objects column.
Before the Altia process exits or needs to close, the GDI object count for the .exe process will be very close to 10,000 if there is a GDI limit issue.
A workaround is to increase the per process GDI limit.
For Windows XP/Vista/7/8 (NOT Windows 10):
- Here is a helpful web page describing the workaround:
- In summary, the workaround is:
- Increase the registry setting for GDIProcessHandleQuota in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows.
- The default setting is 10000 decimal. It can be increased to 65535 decimal. The 65535 value is the theoretical maximum allowed by Windows. The actual maximum number of GDI Objects for a specific computer may be less. With GDI Objects set to 65535 decimal, Altia has seen a design with 17,000 images allocate 17,000 GDI objects successfully. Altia does not have experience with designs using more than 17,000 images. It is not a recommended practice to create designs with so many images. Many large designs seldom exceed 3000 images.
- It may be necessary to reboot the computer for the change to get applied.
For Windows 10:
- Here is a helpful web page describing the workaround:
- In summary, the workaround is:
- Windows 10 must be version 1803 or newer. Earlier versions have a bug that does not allow changing the default setting of 10000 decimal. To find your version, do Windows Start > Settings > System > About, under Windows Specifications, look at the Version.
- Windows 10 x64 has 2 registry entries to change to 65536 decimal:
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota
- HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota
- Windows 10 requires a reboot for the changes to get applied.