Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
valentinbreiz opened this issue Jan 14, 2020 · 10 comments
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Meta The product is the management of the products. Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason.

Comments

@valentinbreiz
Copy link

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

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jan 14, 2020
@zadjii-msft
Copy link
Member

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 zadjii-msft added Area-Build Issues pertaining to the build system, CI, infrastructure, meta Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Meta The product is the management of the products. labels Jan 14, 2020
@valentinbreiz
Copy link
Author

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 ?

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jan 14, 2020
@skyline75489
Copy link
Collaborator

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
Copy link
Collaborator

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.

@valentinbreiz
Copy link
Author

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

@zadjii-msft
Copy link
Member

@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.

@valentinbreiz valentinbreiz changed the title Build errors : Failed to create virtual memory for PCH and others Build errors : Failed to create virtual memory for PCH / Compiler is hout of heap space Jan 15, 2020
@valentinbreiz valentinbreiz changed the title Build errors : Failed to create virtual memory for PCH / Compiler is hout of heap space Build errors : Failed to create virtual memory for PCH / Compiler is out of heap space Jan 15, 2020
@DHowett-MSFT
Copy link
Contributor

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 DHowett-MSFT added the Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason. label Jan 23, 2020
@marcelwgn
Copy link
Contributor

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

@ahmedaniss25
Copy link

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

@chausner
Copy link
Contributor

chausner commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Meta The product is the management of the products. Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason.
Projects
None yet
Development

No branches or pull requests

7 participants