/Zm (Specify Precompiled Header Memory Allocation Limit)
Determines the amount of memory that the compiler allocates to construct precompiled headers.
A scaling factor that determines the amount of memory that the compiler uses to construct precompiled headers.
The factor argument is a percentage of the default size of a compiler-defined work buffer. The default value of factor is 100 (percent), but you can specify larger or smaller amounts.
In earlier versions of Visual C++, the compiler used several discrete heaps, and each had a finite limit. Currently, the compiler dynamically grows the heaps as necessary up to a total heap size limit, and requires a fixed-size buffer only to construct precompiled headers. Consequently, the /Zm compiler option is rarely necessary.
If the compiler runs out of heap space and emits the C1060 error message when you use the /Zm compiler option, you might have reserved too much memory. Consider removing the /Zm option. If the compiler emits the C1076 error message, an accompanying C3859 message specifies the factor argument to use when you recompile by using the /Zm compiler option.
The following table shows how the factor argument affects the memory allocation limit if you assume the size of the default precompiled header buffer is 75 MB.
|Value of factor||Memory allocation limit|
Other Ways to Set the Memory Allocation Limit
To set the /Zm compiler option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see Working with Project Properties.
In the navigation pane, select Configuration Properties, C/C++, Command Line.
Enter the /Zm compiler option in the Additional Options box.
To set the /Zm compiler option programmatically
- See AdditionalOptions.
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.