[VS] 컴파일 Zm 옵션

2016. 6. 28. 20:25프로그래밍/지식창고

728x90
728x90

원문 https://msdn.microsoft.com/library/bdscwf1c.aspx


가끔 사내에서 빌드를 하다보면 Zm 메모리가 부족하다는 이유로 빌드를 실패할 때가 있다.

프로젝트 속성 > C/C++ > Command Line 에서 추가할 수 있다.



여튼 뭔지 좀 찾아봤다. 우리의 친구 MSDN!


/Zm (Specify Precompiled Header Memory Allocation Limit)

미리 컴파일 된 헤더 메모리 할당 제한 옵션이라고 보면 될 것 같다.


Determines the amount of memory that the compiler allocates to construct precompiled headers.

미리 컴파일 된 헤더를 컴파일러가 생성하기 위해 할당하는 메모리를 결정하는 것.



나머진 귀찮으므로 걍 복붙 히히.

Arguments

factor

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

10

7.5 MB

100

75 MB

200

150 MB

1000

750 MB

2000

1500 MB

Other Ways to Set the Memory Allocation Limit

To set the /Zm compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.

  2. In the navigation pane, select Configuration PropertiesC/C++Command Line.

  3. Enter the /Zm compiler option in the Additional Options box.


728x90
반응형