BUILD FAILED: Exception of type 'System.OutOfMemoryException' was thrown.

Topics: Developer Forum
Jan 3, 2008 at 9:19 PM
I am trying to build a large project and it is failing to build at the "GenerateReflectionInfo" step. The following is the message I get.

Sandcastle Help File Builder Console, version
Copyright c 2006-2007, Eric Woodruff, All Rights Reserved

Building Unnamed.shfb

BUILD FAILED: Exception of type 'System.OutOfMemoryException' was thrown.

What I am trying to generate this for is quite a few items...
Info: Loaded 625 assemblies for reflection and 671 dependency assemblies.
Info: Wrote information on 118 namespaces, 10929 types, and 154273 members

Before the system runs out of memory the reflection piece is just under 750mb. I am unsure how many items acctually went into this reflection piece before it died. The machine I am currently using has 2gb of RAM and I am generating in Website format.

Is there any reasons why this dies so quickly? Or is the load just too big? It would be nice to be able to generate this as one file without cutting it up. Any ideas on how to make this work would be great.

Jan 4, 2008 at 1:42 AM
You can go to the working folder and run GenerateRefInfo.bat manually. My guess is that MRefBuilder is what's crashing. If such is the case, your only option is to split the project into something with a smaller number of assemblies that it can handle. 625 assemblies with 671 dependencies is extremely large.

Jan 4, 2008 at 1:18 PM
Edited Jan 4, 2008 at 2:18 PM
Thank you for the response. I will just chunk it up into smaller bits. Ill see what my machine can handle.


Now that I have split up my assemblies, I have noticed that its not the amount of assemblies that is forcing the failed build...

When trying to build 285 assemblies my build failed, but when I built 310 assemblies it is building fine. I noticed from the build log that there are 103 namespaces, 6713 types, and 102085 members with the 285 assemblies. Where as the 310 have only 16 namespaces, 4215 types, and 52179 members.

Which part do I need to try and downsize so that I can build everything? The number of Namespaces, Types, or Members?
Jan 4, 2008 at 3:01 PM
Edited Jan 4, 2008 at 3:01 PM
From the numbers I'd guess that its a combination of the number of types and the number of members. Since there are 103 namespaces in the 285 assemblies, you might see if you can push more of them over into the other project which has fewer types to see if you can get a balance that works.

Jan 4, 2008 at 6:05 PM
I cannot seem to find what the deciding factor is, but it took a 3-way split to get the files to all build.

Assemblies - 221
Namespaces - 5
Types - 483
Members - 6933

Assemblies - 366
Namespaces - 43
Types - 4996
Members - 60101

Assemblies - 37
Namespaces - 76
Types - 5449
Members - 87230

That doesn't really matter as it works to get the files built. The only thing is I now have three separate websites that are built, but I would still really like to have one single search able website. Is there a quick way to integrate the three separate pieces together? Or will I need to hack up the TOC and piece a single one each time and move the html files to a single folder?

Any input you have on this would be great, for now I will continue to mess around with the generated files.
Jan 4, 2008 at 6:52 PM
You should be able to merge the TOC information from each project into a single file. Everything else would remain the same and you'd just have to copy everything to a common folder.

Feb 29, 2012 at 5:47 AM

How to merge TOC info from separate websites? Can I have the detailed steps please?

Mar 1, 2012 at 2:00 AM

There are no detailed steps available.  For the most part, it will involve merging the XML TOC files together and copying everything into one folder.  One problem will be the full text index files.  They can't really be combined easily.