I have found an error during the build process when the project is big. I have an open source 3d party dll with a lot of code (NCrunch says it's 2mln lines of code). I know it's not very good but it's 3d party. So when I do the build NCrunch fails with the out of memory exception. I have done some investigations and found that the build itself is OK but the ncrunchhost.x86 fails after reaching 2gb virtual memory limit after the csc.exe is closed. I guess it's doing analysis of the code in this phase. I went to project configuration and turned off instrument assembly (set to false). Then the build was completed. I don't know if NCrunch has some memory leaks or it just needs a lot of memory for that kind of project but may be it's worth to make these hosts x64 so that they can use more memory?
Remco NCrunch Developer
#3652
05 Feb 2013 20:31 UTC
As part of its instrumentation, NCrunch needs to load and dissect the built assembly in memory in order to manipulate it. On large assemblies, this can be a memory intensive process.
Is this project being included in your solution as a project dependency, or as a referenced DLL?
To ensure compatibility with all environments, NCrunch always uses an x86 process for building and instrumenting projects. I'll make a note to test the reliability of doing this under x64, as it may perform better this way anyway.
Is this project being included in your solution as a project dependency, or as a referenced DLL?
To ensure compatibility with all environments, NCrunch always uses an x86 process for building and instrumenting projects. I'll make a note to test the reliability of doing this under x64, as it may perform better this way anyway.
I have it as a project dependency as a few changes are made to the source. May be you can implement at least an option to switch between x86/x64? So that it's possible to work with large projects as well.
Do you need the project to check the memory consumption? Perhaps there is something special apart from the large amount of code that makes it die with out of memory?
Do you need the project to check the memory consumption? Perhaps there is something special apart from the large amount of code that makes it die with out of memory?
Remco NCrunch Developer
#3657
06 Feb 2013 09:17 UTC
A single assembly file with 2M lines of code is fairly unconventional, so I think it's quite a safe bet that the sheer size of the project is causing the memory problems. The best workaround I can suggest is basically what you've already done - setting the 'Instrument output assembly' setting to 'False' will prevent NCrunch from processing the assembly for code coverage. As you've mentioned that this is a 3rd party component, my assumption is that you probably don't spend the bulk of your time working in this code and the code coverage is probably more or a nice to have.
I also hold a concern that the size of this project will likely cause performance problems for NCrunch even if we are able to solve the out of memory problems. If you have any opportunity to split up the project, I would definitely recommend doing so.
Meanwhile, I've made a note in the backlog to investigate adding an x86/x64 configuration option for the build processes.
I also hold a concern that the size of this project will likely cause performance problems for NCrunch even if we are able to solve the out of memory problems. If you have any opportunity to split up the project, I would definitely recommend doing so.
Meanwhile, I've made a note in the backlog to investigate adding an x86/x64 configuration option for the build processes.
I don't really need code coverage as you say for that project so the solution works pretty well for me and it's not any critical.
May be a small suggestion can be to have a hint on doing that (instrument output assembly = false) somewhere when there is an out of memory exception saying that project is perhaps too big and you can trying doing this.
May be a small suggestion can be to have a hint on doing that (instrument output assembly = false) somewhere when there is an out of memory exception saying that project is perhaps too big and you can trying doing this.
Remco NCrunch Developer
#3662
06 Feb 2013 20:58 UTC
Good thinking :) I'll look into it!
Remco NCrunch Developer
#3906
30 Mar 2013 21:54 UTC
For anyone interested, a new configuration option has been introduced with the newly released version of NCrunch (v1.45) which can control the bitness of the build process (x86/x64) - Build Process CPU Architecture.
Post a reply
Log in to reply.