Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 352509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:44:38+00:00 2026-05-12T11:44:38+00:00

We have a large Visual Studio 2005 C++/Mfc solution, 1 project with around 1300

  • 0

We have a large Visual Studio 2005 C++/Mfc solution, 1 project with around 1300 source files (so about 650 .h and 650 .cpp files). We also use Boost and a few other libraries (COM: MSXML, Office).

Recently, I’ve added a few instances of boost::multi_index to speed up things a bit. This all compiles most of the time. But now, when I’m doing a full (release) rebuild, I get compiler crashes at a few modules.

Fatal Error C1060: "compiler is out of heap space"

I’ve already tried to reduce includes in the precompiled header file (removed pretty much everything except the standard MFC headers). Also, I’ve removed the compiler option /Zm200 (which we needed before to compile the precompiled header file).

The strange thing: when I just press F7 (build) after the compiler crashes, the build process continues without any problems (or at least up to the next compiler crash, where I press F7 again). But it would be nice to be able to do a complete build without any breaks.

Can I influence the build order of the individual modules? This way, I could put the “problematic” modules at the beginning of the process (and hope the crashes don’t just shift to other modules).

BTW: A complete build takes around 90 minutes.


Update:

Thanks for the answers. I was able to get rid of the compiler crashes and reduce compile time significantly. Here’s what I did:

  1. I removed all the includes from the precompiled header file, just the standard windows/mfc headers were left as they were. This forced me to add even more includes into other modules, but in the end everything was included where it was needed. Of course, this step increased compile time, but allowed me to be more efficient in the next step.
  2. I installed the trial version of ProFactors IncludeManager. The Project Detail View can be exported to Excel, where bottlenecks and candidates to be included in the precompiled header file can be spotted quite fast.
  3. Most compile time was wasted with a few header files that included a heap of other header files (that included some more…). I had to use forward declarations to get rid of some nasty dependencies. Also, I moved some classes / functions out of critical headers into their own modules.
  4. What to put in precompiled header? (MSVC) helped me getting the includes in the precompiled header file right. I’ve added STL, Boost, Windows headers. then added our own (more or less stable, optimized) headers, plus the resource header file.
  5. I repeated steps 3 and 4 a few times, always checking with IncludeManager for new candidates.
  6. Steps 1 to 5 brought compilation time (release mode) down, from 90 to about 45 minutes.
  7. I disabled generation of Browse Information for everything, since we do not seem to use it (and I could not find any information for what it is really good for…). This cut off another 6 minutes of the build process.
  8. I added the /MP (multi processor support) switch to the C++ compiler command. Now the rebuild time was down to 22 minutes. This was all done on a single core PC.
  9. I moved the whole solution to a dual core PC. Rebuilding the project takes 16 minutes there.
  10. Creating a debug build is 5 minutes faster:
    • 17 minutes on the single core machine,
    • 11 minutes on the dual core machine.

Update 2:

Above, where I mention “single core machine”, actually a slower dual core machine is meant.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:44:38+00:00Added an answer on May 12, 2026 at 11:44 am

    If 1300 files are taking THAT long to compile then you are including waaaay too many header files that are unncecessary. I’d guess people have cut and pasted a bunch of headre files into a CPP file without thinking which headers they actually need so that loads of them are getting included when they ought not to be. I’m also guessing that you aren’t forward declaring classes where you should be.

    I’d suggest you need to spend some time going through your project and removing unnecessary #includes. I suspect this will fix your out of memory problems AND will improve your compile time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 231k
  • Answers 231k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the following function like this: Image('/path/to/original.image', '1/1', '150*', './thumb.jpg');… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer Check you database schema to see if the field (referenced… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer I figured out the problem - there was a session… May 13, 2026 at 2:13 am

Related Questions

We have fairly large C++ application which is composed of about 60 projects in
Is there a flag for gcc such that conversions from a long to a
I am having trouble with my Visual Studio 2005 IntelliSense for some time now.
What setting(s) in a Visual Studio 2005 project could cause the build to not

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.