Build errors : Failed to create virtual memory for PCH / Compiler is out of heap space #5899

Closed
opened 2026-01-31 00:24:48 +00:00 by claunia · 10 comments
Owner

Originally created by @valentinbreiz on GitHub (Jan 14, 2020).

Environment

Windows build number:  Microsoft Windows 10 Pro 10.0.18363 N/A Build 18363
Windows Terminal version (if applicable): 4129ceb904f9f9a413d2673ce42e7f086a5f10a9

Steps to reproduce

Open OpenConsole.sln, restore packages, x64 CPU, WindowsTerminalUniversal Project, Release Mode, Start Debugging (F5)

Expected behavior

I'm trying to build the terminal for the first time.

Actual behavior

Multiple errors.

image

logs.txt

Originally created by @valentinbreiz on GitHub (Jan 14, 2020). # Environment ```none Windows build number: Microsoft Windows 10 Pro 10.0.18363 N/A Build 18363 Windows Terminal version (if applicable): 4129ceb904f9f9a413d2673ce42e7f086a5f10a9 ``` # Steps to reproduce Open OpenConsole.sln, restore packages, x64 CPU, WindowsTerminalUniversal Project, Release Mode, Start Debugging (F5) # Expected behavior I'm trying to build the terminal for the first time. # Actual behavior Multiple errors. ![image](https://user-images.githubusercontent.com/18724279/72347243-f97feb00-36d7-11ea-8e50-7de8ab193d04.png) [logs.txt](https://github.com/microsoft/terminal/files/4059257/logs.txt)
Author
Owner

@zadjii-msft commented on GitHub (Jan 14, 2020):

Thanks for the report! This is pretty common when running the build for the first time. The precompiled headers for C++/WinRT are pretty enormous, so it takes a good amount of free memory to build them initially. How much RAM do you have on the machine that's trying to build the Terminal?

Usually when I hit this, I close a few old browser tabs and just try again. Almost always does the trick 😝

sidebar: "WindowsTerminalUniversal" isn't actually the package you want to run, you want "CascadiaPackage"

@zadjii-msft commented on GitHub (Jan 14, 2020): Thanks for the report! This is pretty common when running the build for the first time. The precompiled headers for C++/WinRT are pretty enormous, so it takes a good amount of free memory to build them initially. How much RAM do you have on the machine that's trying to build the Terminal? Usually when I hit this, I close a few old browser tabs and just try again. Almost always does the trick 😝 _sidebar_: "WindowsTerminalUniversal" isn't actually the package you want to run, you want "CascadiaPackage"
Author
Owner

@valentinbreiz commented on GitHub (Jan 14, 2020):

Thanks! But it still doesn't work, even with all apps closed, same errors... My computer have 16GB of RAM but I don't know if enough is dedicated. How can I specify the amount ?

@valentinbreiz commented on GitHub (Jan 14, 2020): Thanks! But it still doesn't work, even with all apps closed, same errors... My computer have 16GB of RAM but I don't know if enough is dedicated. How can I specify the amount ?
Author
Owner

@skyline75489 commented on GitHub (Jan 15, 2020):

I had the exact issue when I tried to compile the project for the first time. Initially I had 16GB of physical memory and I increased the virtual memory to about 20GB and it worked. Later I upgraded my PC to 32GB of physical memory. Then the virtual memory does not matter any longer.

@skyline75489 commented on GitHub (Jan 15, 2020): I had the exact issue when I tried to compile the project for the first time. Initially I had 16GB of physical memory and I increased the virtual memory to about 20GB and it worked. Later I upgraded my PC to 32GB of physical memory. Then the virtual memory does not matter any longer.
Author
Owner

@skyline75489 commented on GitHub (Jan 15, 2020):

By the all my hard drives are SSD so the virtual memory is I guess fast enough. And I highly suggest you to put all the source code on SSD if you have not done it. It is so much faster than HDD in terms of basically everything.

@skyline75489 commented on GitHub (Jan 15, 2020): By the all my hard drives are SSD so the virtual memory is I guess fast enough. And I highly suggest you to put all the source code on SSD if you have not done it. It is so much faster than HDD in terms of basically everything.
Author
Owner

@valentinbreiz commented on GitHub (Jan 15, 2020):

Thank you for the informations! But that's a shame to require so much RAM to compile a simple program :/

@valentinbreiz commented on GitHub (Jan 15, 2020): Thank you for the informations! But that's a shame to require so much RAM to compile a simple program :/
Author
Owner

@zadjii-msft commented on GitHub (Jan 15, 2020):

@valentinbreiz Yea it's not something that we're happy about. It's an unfortunate limitation of C++WinRT at the moment. We've had a bunch of discussions with them about this exact concern. The hope is that with modules in C++20, we won't have to worry about this anymore, but unfortunately there's not much we can do until then that we haven't already done.

@zadjii-msft commented on GitHub (Jan 15, 2020): @valentinbreiz Yea it's not something that we're happy about. It's an unfortunate limitation of C++WinRT at the moment. We've had a _bunch_ of discussions with them about this exact concern. The hope is that with modules in C++20, we won't have to worry about this anymore, but unfortunately there's not much we can do until then that we haven't already done.
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 23, 2020):

Unfortunately, I've gotta close this one- Terminal requires a bunch of RAM to compile right now, and that's something we'll be trying to tackle as time goes on. With apologies, d.

@DHowett-MSFT commented on GitHub (Jan 23, 2020): Unfortunately, I've gotta close this one- Terminal requires a bunch of RAM to compile right now, and that's something we'll be trying to tackle as time goes on. With apologies, d.
Author
Owner

@marcelwgn commented on GitHub (Mar 12, 2020):

Something that might be worth mentioning is that adding "/Zm1000" to the build options of some projects helps resolve issues C1076 and C3859, which are related to memory limitations.

Here the link for the documentation of "/Zmfactor":
https://docs.microsoft.com/en-us/cpp/build/reference/zm-specify-precompiled-header-memory-allocation-limit?view=vs-2019

@marcelwgn commented on GitHub (Mar 12, 2020): Something that might be worth mentioning is that adding "/Zm1000" to the build options of some projects helps resolve issues C1076 and C3859, which are related to memory limitations. Here the link for the documentation of "/Zmfactor": https://docs.microsoft.com/en-us/cpp/build/reference/zm-specify-precompiled-header-memory-allocation-limit?view=vs-2019
Author
Owner

@ahmedaniss25 commented on GitHub (Jul 4, 2020):

problem fixed here : https://youtu.be/Oh6dga-Oy10

@ahmedaniss25 commented on GitHub (Jul 4, 2020): problem fixed here : https://youtu.be/Oh6dga-Oy10
Author
Owner

@chausner commented on GitHub (Nov 6, 2023):

Also ran into this issue, even with 16 GB RAM. What worked for me was to simply restart the build repeatedly until it finally managed to build everything (make sure to use "Build", not "Rebuild"). The number of compiler errors should drop between each build.

@chausner commented on GitHub (Nov 6, 2023): Also ran into this issue, even with 16 GB RAM. What worked for me was to simply restart the build repeatedly until it finally managed to build everything (make sure to use "Build", not "Rebuild"). The number of compiler errors should drop between each build.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5899