Hi, thanks for sending through the log file.
I'm presently aware of two things that can cause out of memory exceptions in the manner that you've reported:
1. Tests (or code under test) consume large amounts of memory such that there isn't enough memory space available for NCrunch to return results at the end of the run
2. Tests are creating a large amount of trace/console output that reduces memory efficiency and the process runs out of memory at the end of the run
I would say #2 is probably the most likely scenario here. There are plenty of things you can do here:
- Try changing the
Use CPU architecture setting for this test project to x64. NCrunch will use x86 by default, which has a much lower memory limit of 2GB.
- Try adjusting the code involved to reduce the amount of trace output. If you have some kind of logging facility involved, turning down the verbosity may help.
- Try adjusting the 'Test process memory limit' for the test project to something sensible. This will make NCrunch recycle the test process if the memory consumption gets too high, which might make a difference if memory is staying allocated between batches.
- Apply NCrunch.Framework.IsolatedAttribute to some of the tests in here that have very high memory consumption. NCrunch will always run isolated tests in their own process, so you won't see the same issues with memory consumption accumulating between tests.