21 Replies Latest reply on Apr 16, 2018 9:26 AM by David Matula

    GDI Objects and User Objects study

    Shaodun Lin

      GDI Objects and User Objects study | LinkedIn

      Occasionally, after working on your complex design project for many hours, you may see this warning message: "Warning! Available windows resources are critically low. SOLIDWORKS cannot open any more windows. Close some open SOLIDWORKS documents."

      Or a warning message like this:

      0?e=2123186400&v=beta&t=NX2vb1p_02D2F7-mxsNK76vE0clS0TGYQ4xA3OLewCg

      If you ignore that warning message, you may see this critical error message and end up the SOLIDWORKS application may be crashed.

      0?e=2123186400&v=beta&t=OHrUYBLqYinIMHDs4WMwtFsvpDoRXvY75zGITzPMLYA

      Above warning messages happened typically after you had used SOLIDWORKS for many hours and opened/closed many documents without restarting the SOLIDWORKS application. But interestingly, if you check the memory usage of SOLIDWORKS application in the Task Manager, mostly you may find out that the system still has plenty amount of RAM left over and you may wonder why the warning message window resources are critically low was reported when the RAM is not used up?

      So, what exactly happened?

      Actually, many of users may not aware that the windows resources are not just about RAM, it may refer to :

      • Physical Memory – the amount of RAM in the system.
      • Virtual Memory – the Page File used by the SOLIDWORKS process.
      • Desktop Heap – OS memory reserved for USER Objects like windows, menus, cursors, icons, and menu keyboard shortcuts.
      • GDI Objects – Resources that support graphics like fonts, bitmaps, brushes, pens, and drawing surfaces.

       

      If any of the resources are used up by SOLIDWORKS application, the SOLIDWORKS Resource Monitor will start to warn you – that was a new feature introduced since SOLIDWORKS 2011 release.To many users, when they see the warning message, mostly it is not because of insufficient RAM ( especially if you have more than 16GB of RAM ), it is because the GDI Objects or the User Objects had reached their limit. Luckily, you can customize these values in Windows registry to suit your needs. In order to find out what is the proper setting of these two values, I performed a series of tests:

       

      Test 1: Number of parts opened vs. the GDI Objects and User Objects value

      Test condition: SW2017SP4.1, Win8.1, open parts from Windows Explorer.

      0?e=2122718400&v=beta&t=E6FO0ZfC-4ZADQJaDT3g5BdvE2FNRGqFxzPHOA2gPuM

      Comment: Test 1 shows the GDI Objects and User Objects value ( from Task Manager) is proportional to the number of parts opened in SOLIDWORKS. If use default setting GDIProcessHandleQuota = 10000, SOLIDWORKS is able to open 47parts before reaching the limit.

       

      Test 2: GDI Objects and User Objects per document based on different document types and SOLIDWORKS versions, open files from Windows Explorer

      Test condition: Open 100X documents from Windows Explorer.

      0?e=2122718400&v=beta&t=Np5etDynretbVWO2Txp3sRGDBag2VPetTt_oGqxWglo

      Comment: Test 2 shows, when opening assembly documents, SOLIDWORKS will use slightly more GDI objects and User Objects compare with opening the part and drawing documents. Above test result also shows SW2017 uses about 10 more GDI objects and User Objects per document compare with SW2016.

       

      Test 3: GDI Objects and User Objects per document based on different document types and SOLIDWORKS versions, open files from PDM Vault

      Test condition: Open 100X documents from PDM Vault

      0?e=2122718400&v=beta&t=39rAqIWAaZosM7EzNIgAyRgXxJgDQdaQSpC6DXBj9-0

      Comment: Compare Test 3 and Test 2, when opening documents from PDM vault, SOLIDWORKS application will use more GDI Objects and User Objects compares with opening from Windows Explorer. Take SW2017SP4.1 as an example, it will use 100 more GDI Objects per document when opening files from PDM vault. Based on the result from Test 1, for the same GDI limit, now you can only open 30 documents instead of 47 documents, which means for PDM user, they need to increase the GDI Objects and User Objects limits to avoid the warning message from SOLIDWORKS Resource Monitor.

      Recommended setting for GDI Objects and User Objects

      The setting is based on typically how many documents the user is working on concurrently and whether the user is working with SOLIDWORKS PDM. ( Note: I had added 20% buffer and round up the number )

      0?e=2122718400&v=beta&t=8hq2wf2NnUoqFlQbQpQAzfuyr0I7chO0PP9wBwTxPx4

       

      How to set the GDI Objects and User Objects ( Please back up your registry before making any changes )

      1. Press WIN + R key to lunch the Run command dialogue, type Regedit and press Enter.

      0?e=2123186400&v=beta&t=dwvlZ564mB1lKCGqs4VaHmqvGy2w9yXEoeJtQcRZp7Q

      2. Click OK if you see this UAC warning message.

      0?e=2123186400&v=beta&t=ETUV1Ola5qr85apzyoPH1nyupqu8zXt5eg2OsiY15NA

      3. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows and locate the registry keys: GDIProcessHandleQuota and USERProcessHandleQuota, the range for GDIProcessHandleQuota is 256 ~ 65536 and the default value is 10000 ( Decimal), the range for USERProcessHandleQuota is 200 ~ 18000 and the default value is 10000 ( Decimal).

      0?e=2123186400&v=beta&t=qW59sqXiOZYe3Db9Ws_D3m-fVbWJ4QOEv1dp4Lly4SE

      4. Double click the key to edit the value, please make sure select the correct base (Hexadecimal / Decimal ) when key in the value

      5. Reboot the computer after you had made change to the registry value.

      6. Use the Testlimit tool to check if the setting works. Below picture shows my GDI objects limit is 36860 and my User Objects limit is 20000.

      Hopefully this study will help you have a better understanding of Windows Resources and how to set the GDI Objects and User Objects based on your working condition to improve your SOLIDWORKS reliability. Feel free to comment and share this post.

       

      Reference:

      1.SOLIDWORKS Knowledge Base: S-048683, S-048684,S-055440

      2. https://forum.solidworks.com/thread/112993

      3. http://www.goengineer.com/2017/09/01/system-resources-running-low/blog/

      Note 1: I also performed another study to see what is the effect to windows resources used by SOLIDWORKS application after open and close multiple documents, it seems the GDI objects and RAM used by SOLIDWORKS application will not be completely released after the documents are closed, for example, the GDI objects grows from 898 to 3456, and the RAM used grows from 360MB to 1075MB after open and close documents for 20 times, which means it is advisable for user to restart the SOLIDWORKS application periodly to completely release the windows resource, to ensure the stability of using SOLIDWORKS application.

      Note 2: The Windows resource limits how many files can be opened concurrently by an application. I just did another test, you won't be able to open more than 60 files using 32bit Excel, this time, the limitation is the amount of RAM can be addressed by a 32bit application, you will see this kind of error message when Excel hits the limit.

      2018-01-02_14-09-06.jpg

      I also tried to compare the GDI objects and User objects per document when opening Excel files from Windows Explorer and PDM Vault. When opening files from PDM Vaults, the number of GDI objects and User objects per document are slightly higher, but the difference is not as significant as compared with opening SOLIDWORKS documents from Windows Explorer and PDM Vault.

      2018-01-02_15-29-33.jpg