Skip to content

HOW TO: fix Windows compilation error **regarding virtual memory for PCH .. internal heap limit reached** #88

@geekrelief

Description

@geekrelief

During compilation if you it stops and you see something like:

C3859: Failed to create virtual memory for PCH

c1xx: note: the system returned code 1455: The paging file is too small for this operation to complete.

c1xx: note: please visit https://aka.ms/pch-help for more details
c1xx: fatal error C1076: compiler limit: internal heap limit reached
c1xx: note: the system returned code 1455: The paging file is too small for this operation to complete.

This is due to the Visual C++ compiler trying to load the PCH file into memory for each thread on the CPU. The PCH file is around 2GB and can grow depending on additional modules included, and sometimes Windows virtual memory system can't respond quickly enough to all the memory the compiler is requesting. So the usual course was to rerun the compilation until it worked.

The fix is to increase the virtual memory:
(1) by going to the System settings > About (Advanced system settings) or running sysdm.cpl to open the System Properties.

(2) go to: Advanced tab (Performance -> Settings button) >Advanced tab (Virtual Memory -> Change).

Disable Automatically manage paging file size for all drives. For the C: if it says System Managed, select it and choose Custom size. I set the initial size to be equal to my system memory (64GB) so 64000MB and the max to be double. Then click Set and reboot. The amount might be overkill, but I haven't run into the error since.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions