Skip to content

Commit 2b8e24e

Browse files
authored
Update compiler-error-c3859.md
1 parent e5ea0f7 commit 2b8e24e

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

docs/error-messages/compiler-errors-2/compiler-error-c3859.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,25 @@ helpviewer_keywords: ["C3859"]
1010
> Failed to create virtual memory for PCH
1111
1212
The message will have one of the following notes:
13-
>PCH: Address is not a multiple of the system's allocation granularity
14-
>PCH: The chunk has not been previously reserved
15-
>PCH: Commit size too large
16-
>PCH: Unable to commit memory across file map
17-
>PCH: Exhausted chunk list before committing all bytes
18-
>PCH: Unexpected end of chunk list while trying to free
19-
>PCH: Shouldn't be hitting a file map in the decommit case
20-
>PCH: Invalid chunk
21-
>PCH: Map size too large
22-
>PCH: Unable to map file: memory already committed
23-
>PCH: File map already in place
24-
>PCH: Unable to get the requested block of memory
25-
>consider using /Fp to allow the compiler to reserve the memory early
13+
>the system returned code *error code*: *OS error message*\
14+
>PCH: Address is not a multiple of the system's allocation granularity\
15+
>PCH: The chunk has not been previously reserved\
16+
>PCH: Commit size too large\
17+
>PCH: Unable to commit memory across file map\
18+
>PCH: Exhausted chunk list before committing all bytes\
19+
>PCH: Unexpected end of chunk list while trying to free\
20+
>PCH: Shouldn't be hitting a file map in the decommit case\
21+
>PCH: Invalid chunk\
22+
>PCH: Map size too large\
23+
>PCH: Unable to map file: memory already committed\
24+
>PCH: File map already in place\
25+
>PCH: Unable to get the requested block of memory\
26+
>consider using /Fp to allow the compiler to reserve the memory early\
2627
2728
There isn't enough virtual memory allocated for your precompiled header. If your precompiled header uses an explicit `#pragma hdrstop` directive, use the **`/Zm`** compiler flag to specify a larger value for the precompiled header file. Otherwise, consider reducing the number of parallel compilation processes in your build. For more information, see [`/Zm` (Specify precompiled header memory allocation limit)](../../build/reference/zm-specify-precompiled-header-memory-allocation-limit.md).
2829

30+
This disganotic primarily in two scenarios.
31+
32+
The first scenario is that the system is overloaded with multiple `/Yu` compile requests at the same time. In this scenario setting the maximum starting virtual memory size typically resolves the issue.
33+
34+
The second scenario is when the the Windows loader injects a DLL into the process at startup. That injected DLL can allocate memory which conflicts with where the PCH must reside. For example, `msbuild.exe` will inject `FileTracker.dll` into every `CL.exe` process at startup. In this scenario, using the [`/Fp` (Name .pch file)](../../build/reference/fp-name-dot-pch-file.md) flag will ensure that the memory for the PCH is allocated as early as possible in the `CL.exe` process, before any injected DLL. These failures can be intermittent because Windows ASLR will allocate memory at different address across different process invocations. Without `/Fp`, memory for the PCH cannot be allocated until the compiler has compiled enough of the program to see the header file specified in the `/Yu` command line option or the `#pragma hdrstop`. By this time, it is much more likely that the memory required by the PCH will already be reserved.

0 commit comments

Comments
 (0)