ArcMap crashes during or after opening a document containing map service layers


When using ArcMap versions 10.5.x or later, ArcMap either crashes while attempting to open, or after opening an existing map document (.mxd) that contains map services.

ArcMap may crash when switching between tabs in the Table Of Contents, adding other layers, editing features, changing a layer's visibility, using the Field Calculator, or running a geoprocessing tool. Additionally, the amount of time that passes before the application crashes depends on the layers or geoprocessing tools used after opening the .mxd.

Because an application may crash for a variety of reasons, this technical article provides suggestions that can help determine if the cause of the crash is related to system limitations.


    Most crashes are related to the number of Graphical Device Interface (GDI) objects exceeding application limitations. This is most common in situations where map services are added to the MXD, as these may contain tens or hundreds of legend items with multiple symbol classes.

    In Windows XP and later, the system-wide limit is 216, or 65,536 GDI objects. This is managed by the OS by limiting the object count between open applications; ArcMap is limited to 10,000 GDI objects. The number of GDI objects ArcMap is consuming can be viewed any time through the Task Manager:

    1. Open Task Manager.
    2. Select the Details tab. Right-click the column header > Select columns.
    3. Check the box for GDI objects, and click OK.
    4. Locate the ArcMap application in the task list.

    For example, the GDI object count increases when opening an MXD, adding layers to the MXD, switching between tabs in the Table Of Contents, or displaying legend items. If the MXD contains a map service, or if a map service is added to ArcMap, this further increases the GDI object count if the map service contains a large number of layers.

    As a precaution, ArcMap does not display more than 100 legend items per map service layer, but this does not account for the situation where hundreds of map service layers each contain less than 100 legend items. Even though ArcMap may not crash at the time of adding the map service layers, navigating around ArcMap or performing analysis on layers in the map may result in exceeding the 10,000 GDI object limit.

    Read more:

    Solution or Workaround

    Use one or more of the following solutions, if applicable, to resolve any application crash issues when working with map services in ArcMap.

    • Upgrade ArcMap to 10.7.x to see if it resolves the crash. Esri has made improvements for ArcMap 10.7 that have stopped the high number of reports received for these types of crashes. If ArcMap still crashes, proceed to the next solution.
    • Open the document in ArcGIS Pro, as the application does not have the same limitations as ArcMap. In ArcGIS Pro, import your map document by creating a Blank project and select Import Map from the Insert tab.
    • Use the Advanced ArcMap Settings utility to set the maximum legend item count to zero. In ArcMap 10.5.x and later, this utility (AdvancedArcMapSettings.exe) is found at:
      <drive>\Program Files (x86)\ArcGIS\Desktop10.x\Utilities\AdvancedArcMapSettings.exe
      Follow the instructions below to modify the number of map service layer legend items that ArcMap is allowed to draw.
      1. Close all instances of ArcMap running on the machine.
      2. Open the Advanced ArcMap Settings utility.
      3. Switch to the TOC/Data tab.
      4. In the Map server layers group, change the value for maximum number of legend items from each Map Server layer from 100 to 0.
      5. Restart ArcMap. Open the problematic MXD, or add the map service layers.

    Article ID:000021092

    • ArcMap

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options

    Related Information

    Discover more on this topic