Knowledge Base - Technical Articles


Technical Article   Error:  Cannot map metafile into memory. Not enough memory

Article ID: 20294
Software:  ArcGIS - ArcEditor 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcInfo 8.0.1, 8.0.2, 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS - ArcView 8.1, 8.1.2, 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10 ArcGIS for Desktop Advanced 10.1, 10.2, 10.2.1, 10.2.2, 10.3, 10.3.1 ArcGIS for Desktop Basic 10.1, 10.2, 10.2.1, 10.2.2, 10.3, 10.3.1 ArcGIS for Desktop Standard 10.1, 10.2, 10.2.1, 10.2.2, 10.3, 10.3.1
Platforms: N/A

Error Message

When exporting or printing a large map, the following error message is displayed.

"Cannot map metafile into memory. Not enough memory"

This prevents the output file from being created and deletes the interim Enhanced Windows Metafile Format (EMF) file.

Cause

When ArcMap prints or exports to any format, a series of 100 MB EMF files are created. Windows attempts to allocate enough memory to read each 100 MB size EMF metafile. If it cannot allocate a large enough contiguous block of memory, Windows returns a NULL or '0' EMF handle, and ArcMap displays the error message.

Memory in Windows is a combination of physical RAM and disk paging files. Memory is allocated when an application is launched, and it is released when that application is shutdown. Continuous use of applications causes fragmentation of memory and reduces the size of the largest contiguous block. Memory is slowly defragmented when the machine is allowed to sit idle, such as no processing or mouse movements.

An E-size map with raster elements, either raster data or rasterized vector objects, such as those having transparent or picture fill/marker symbology, can easily reach total temp file sizes of 2 to 4 GB. The interim EMF file used to store 2 GB of draw commands is represented as a chain of twenty 100 MB files on disk.

When creating a map of this size or larger, Windows must find at least 100 MB of contiguous (perfectly unfragmented) memory or it returns a NULL handle, and the error is triggered. Because any application or service running on the machine can fragment memory, perfectly contiguous 100 MB memory blocks become scarce after even moderate use. Preserving contiguous memory is difficult even on machines with large amounts of RAM (2048 MB and up), and plenty of disk space for the page file (4 GB and up).

Solution or Workaround

Question
What is the preferred method for exporting and printing items in ArcMap? Answer
It is highly recommended to use ArcGIS Pro for printing and exporting, especially when experiencing issues caused by the limitations of the ArcMap display engine. More specifically, ArcGIS Pro is not restricted by the graphical device interface (GDI) limitations that some users experience in ArcMap. For example, transparency is natively supported in ArcGIS Pro, preventing the rasterization of layers. Additionally, ArcGIS Pro supports transparency in layout elements.

  ArcGIS Pro does not support exporting Adobe Illustrator files; it is recommended to export using PDF or SVG instead. Also, because ArcGIS Pro does not use the Windows GDI, font substitution or fallback does not occur in ArcGIS Pro. Boxes may appear if using characters unsupported by the chosen font.

If using ArcGIS Pro is not an option, use one of the following workarounds to resolve this issue.

  • Change the output size limit setting in the registry to generate smaller temporary metafile (EMF) draw files. -show me-

    Summary
    Instructions provided describe how to change the size of the output temporary metafile Enhanced Windows Metafile Format (EMF) that is generated. The default value and the value used when this registry entry is absent is hex 6400000 (decimal 104,857,600). To force ArcMap to create smaller temporary files, create a registry entry containing a value lower than decimal 104857600. Decimal 32000000 is a good alternative.

    Smaller temporary metafile sizes can alleviate "Cannot map metafile into memory. Not enough memory" errors experienced during printing or exporting in ArcGIS.



     WARNING: The instructions below include making changes to essential parts of your operating system. It is recommended that you backup your operating system and files, including the registry, before proceeding. Consult with a qualified computer systems professional, if necessary.

    Esri cannot guarantee results from incorrect modifications while following these instructions; therefore, use caution and proceed at your own risk.



     The following procedure alters the printing and export behavior of ArcMap and other ArcGIS applications, and should only be performed by advanced users. Take caution when setting the values described here, since incorrect values for these settings can cause all printing and exporting from ArcMap to fail.

    Procedure
    To force ArcGIS to create smaller temporary files, change the output temporary file size setting to a lower value.

    1. Close ArcMap.
    2. Navigate to Start > Run, type 'regedit', and click OK.
    3. Expand HKEY_CURRENT_USER\Software\ESRI\Display.
    4. Navigate to Edit > New > DWORD Value.
    5. Enter 'OutputSizeLimit' without quotes as the key name, and press Enter.
    6. Double-click OutputSizeLimit to enter a Data value.
    7. Click the Decimal radio button in Base, and enter the following value: 32000000.
    8. Click OK; the Data value is displayed as '0x01e84800 (32000000)' without quotes.



      [O-Image] OutputSizeLimitRegEditScreen32MB
    9. Close the Registry Editor.
    10. Restart ArcMap or any other ArcGIS application.

  • Simplify and generalize the map data. Reduce the usage of raster data. Use the clip tools in ArcToolbox to generate new data that focuses on the data required for the layout.
  • Reduce the display quality of all raster layers. -show me-

    1. Right-click the raster layer in the Table of Contents and select Properties.
    2. In the Layer Properties dialog box, select the Display tab.
    3. Lower the display quality in the Display Quality slider from Normal.
    4. Click OK.
    [O-Image] Raster Display Quality
  • Increase the virtual memory to the maximum usable by the Windows operating system. -show me-

    Summary
    Instructions provided describe how to adjust the system's virtual memory settings. For the maximum benefit, set this value to the maximum available on the Windows operating system. For Windows 2000 and XP, the maximum available is 4096MB (4GB).

     Windows 2003 Server, Windows 2008 Server, Windows Vista and Windows 7 can be set higher values than 4GB. See the link in the Related Information section below.

    Procedure
    The drive selected for the virtual memory should have enough free space to store the page file, as defined by the initial and maximum settings. If the amount of free space on the drive is less than the virtual memory settings, the page file size uses all the available drive space. In that case, clear some space on the drive or set the virtual memory to another drive.

    Select an operating system below.

    • Windows 7, Windows Server 2008 and Windows Vista:

      1. Click Start > Control Panel > System.
      2. Under Tasks, click 'Advanced system settings'.
      3. In the System Properties dialog, click the Advanced tab.
      4. Click Settings under Performance.
      5. Click the Advanced tab, and click Change under Virtual Memory.
      6. Select the drive to use to store the paging file.
      7. Select Custom size and set Initial size (MB) and Maximum size (MB). For the initial size, Microsoft recommends using the recommended value in the 'Total paging file size for all drives' box.
      8. Click Set, and click OK twice.
      9. Click Restart Now.

    • Windows XP and Windows Server 2003:

      1. Click Start > Settings > Control Panel.
      2. Double-click the System icon.
      3. In the System Properties dialog, click the Advanced tab.
      4. Click Settings under Performance.
      5. In the Performance Options dialog, click the Advanced tab, and under Virtual memory, click Change.
      6. In the Virtual Memory dialog box, select a drive to store the paging file.
      7. Set Initial size (MB) and Maximum size. For the initial size, Microsoft recommends using the recommended value in the 'Total paging file size for all drives' box.
      8. Click Set, and click OK twice.
      9. Click Restart Now.

       To have Windows select the best paging file size, click 'System managed size' in the Virtual Memory dialog box.

    • Windows 2000:

      1. Click Start > Settings > Control Panel.
      2. Double-click the System icon.
      3. In the System Properties dialog box, click the Advanced tab and click Performance Options.
      4. In the Performance Options dialog, under Virtual memory, click Change.
      5. In the Virtual memory dialog box, select a drive.
      6. Under 'Paging file size for selected drive', type new values for initial and maximum sizes for the disk.
      7. Click Set, click OK twice.
      8. In the Performance Options dialog, click OK.
      9. Click OK in the System Properties dialog, and click Yes in the System Settings Change dialog to restart the computer.

       When the Virtual Memory dialog box is first displayed, it shows the initial and maximum page file sizes stored on each disk.

  • Restart the computer, and without running any other applications, immediately open and export the MXD document. Restarting releases memory allocations, and this may help export or print the map successfully.
  • Discontinue using highly-compressed raster formats, such as MrSID or ECW, which must be completely uncompressed during the output process and can consume a lot of computer resources, including paging file. See the corresponding link in the Related Information section below for more information.
  • Remove layers symbolized with transparency or BMP/picture marker symbology from group layers that are turned on and currently being displayed.
  • Eliminate transparencies, picture fill symbols, and picture marker symbols from the map. This reduces the amount of raster data in the output. -show me-
    Description
    Maps printed or exported from ArcMap are bitmapped, scattered, banded, or display with low quality.
    Cause
    This happens for several reasons, independently or combined:

    • The maps are printed or exported with either a low output resolution or a low Output Image Quality (OIQ) setting.

    • The map uses a picture/bitmap fill, picture marker, and/or transparent symbology.

    When exported or printed, ArcMap flattens and rasterizes the layer that is symbolized with either a picture fill, picture marker or transparency, and any layers beneath it in the Table Of Contents (TOC).

    Other data frames in the map that do not contain picture fills, picture markers, or transparency are not effected.
    Solution or Workaround
    Question
    What is the preferred method for exporting and printing items in ArcMap? Answer
    It is highly recommended to use ArcGIS Pro for printing and exporting, especially when experiencing issues caused by the limitations of the ArcMap display engine. More specifically, ArcGIS Pro is not restricted by the graphical device interface (GDI) limitations that some users experience in ArcMap. For example, transparency is natively supported in ArcGIS Pro, preventing the rasterization of layers. Additionally, ArcGIS Pro supports transparency in layout elements.

      ArcGIS Pro does not support exporting Adobe Illustrator files; it is recommended to export using PDF or SVG instead. Also, because ArcGIS Pro does not use the Windows GDI, font substitution or fallback does not occur in ArcGIS Pro. Boxes may appear if using characters unsupported by the chosen font.

    If using ArcGIS Pro is not an option, use any of the following options below.

    • Increase the output resolution.
      -show me-
    • Increase the Output Image Quality (OIQ) setting.
      -show me-
    • Reorder the map elements and layers to have layers containing picture fill, picture marker, or transparent symbols at the lowest possible order in the Table Of Contents.
    • Replace the Picture Fill symbols with simpler, vector fills.
    • Replace the Picture Marker symbols with font-based vector marker symbols.
    • Remove transparency. For exported maps, transparency can be re-applied to the desired elements in an external editing application, such as Adobe Illustrator.


Related Information


Created: 8/15/2001
Last Modified: 9/23/2015

Article Rating: (7)
If you would like to post a comment, please login

Comments

By gonzaloavf - 02/16/2012 5:29 AM

The article is incorrect or the solution didn’t work.

A brief classification of the workarounds: *Change the output size limit ... - it did not work; *Simplify and generalize the map data ... First, my map did not have any raster, only pictures on it, on an already very poor resolution, second, what´s the use of it if I am working on arcserver services for data providing? *Reduce display quality ... read obs above *Increase virtual memory ... did not work *Restart the computer ... this is like the joke everybody knows on the four friends (a mechanic, a chemist, an electrician and a IT pro) that had a problem in their car and the first three tried solution in their fields which had no effect until finally the IT pro called them to get out of the car and go in again and then the car started running again. *Discontinue using high compressed ... this is not my case, none raster *Remove layers ... I do not have them and what´s the use of such resource if you cannot use it? *Eliminate transparencies bla bla bla ... read above. Finally, I did not have this caveat on printing on my previous machine with a quarter of the RAM I have now with one processor only, on 32b, the same AGis license. My hardware uprade(now a Dell Optiplex 790) side kicked a downgrade on my software. "There is no political solution to our troubled evolution" I see odd spirits in the machinery world odd spirits. As to the author of the article, he did his best. Jeopardy is on ESRI and DELL and Microsoft all together.

Rating:

By kopeaus - 01/25/2012 10:00 AM

The article needs to be updated.

In step one is 6400000 a typo? Shouldn't it be 6400000? Also the location of the registry key has changed in ArcGIS 10.

Rating:

By Anonymous - 12/11/2010 8:32 AM

The article needs to be updated.

Some changes took place with the company's server. This caused the prints to become unable to plot or exported in *.pdf format. Once I made these changes, the plotting ability was restored. Thanks for the article.

Rating:

By Anonymous - 11/26/2009 6:35 AM

Great article! It helped a lot!

With the article I solved a problem, that I had for more than a few month. Best regards and thanks to the author Andreas

Rating:

By Anonymous - 08/05/2008 3:34 PM

Other - See details below.

Other solution is to make the symbolize layer a raster by adding a 1% transparent in the layer properties > display. Try printing it should work.

Rating:

By Anonymous - 02/08/2007 5:00 AM

Other - See details below.

Can someone tell me when ESRI will fix this problem? This has been a problem since 8.1 and still exists in 9.1. (3.2 didn't have this problem) I've emailed this problem a number of time to my local ESRI support over the last 2 years and still it has not been resolved. Plotting layouts with raster data at sizes greator than A0 is a hit and miss. This is now a well known issue in our industry and forcing our company to look at alternative GIS software to over come this.

Rating:

By Anonymous - 08/30/2006 3:28 PM

The article needs to be updated.

This is a start that at least discusses the bug. None of these suggestions solved the problem, especially trying to export a map book. I tried half a page, removed lots of layers, turned off hill shading and contours. Then I didn't have a map! Will the vectorise fill symbols in 9.2 help? How can I assess how many emf objects I am creating? What would real people do?? Use another mapping package?

Rating:

By Anonymous - 03/13/2003 1:06 AM

It still doesn't answer part of my initial question which was "Why do we have these problems with ArcView 8.2 when an earlier version of your software ie ArcView 3.2a can print the same imagery??