- Overview
- Guides
- Concepts
- Considerations And Constraints
- Absolute File References
- Assembly Colocation Assumptions
- Concurrent Use Of Test Resources
- Cross Application Domain Testing
- Heavily Executed Code Under Test
- Implicit File Dependencies
- Multi Threaded Tests
- Netstandard Test Projects
- Project Atomicity
- Project Build Platform And Configuration
- Rdi Data Point Location
- Test Atomicity
- Unique Test Names
- Using NCrunch With Source Control
- Reference
- Global Configuration
- Overview
- Auto Adjust Clashing Marker Colours
- Build Log Verbosity
- Build Process Memory Limit
- Capabilities Of This Computer
- Coverage Marker Style
- Cpu Cores Assigned To NCrunch Or Ide
- Custom Environment Variables
- Disable Global Hotkey
- Engine Hosting Strategy
- Fast Lane Threads
- Fast Lane Threshold
- Grid Maximum Reconnection Attempts
- Grid Reconnection Delay
- Impact Detection Mode
- Listening Port
- Log To Output Window
- Logging Verbosity
- Marker Colours
- Max Failing Test Trace Log Size
- Max Number Of Processing Threads
- Max Passing Test Trace Log Size
- Max Test Runners To Pool
- NCrunch Tool Window Colors
- Node Id (Name)
- Password
- Performance Aggregation Type
- Performance Display Sensitivity
- Pipeline Optimisation Priority
- Rdi Storage Settings
- Sliding Build Delay
- Snapshot Storage Directory
- Solution Storage Data Limit
- Spinner Colours
- Terminate Test Runners On Complete
- Test Process Memory Limit
- Tests To Execute On This Machine
- Text Output Font
- Workspace Base Path
- Solution Configuration
- Overview
- Additional Files For Grid Processing
- Additional Files To Include
- Allow Parallel Test Execution
- Allow Tests In Parallel With Themselves
- Infer Project References Using Assembly
- Instrumentation Mode
- NCrunch Cache Storage Path
- Only Consider Tests Outofdate If Impacted
- Project Config File Storage Path
- Show Coverage For Tests
- Show Metrics For Tests
- Tests To Execute Automatically
- Project Configuration
- Overview
- Additional Files To Include
- Allow Dynamic Code Contract Checks
- Allow Static Code Contract Checks
- Analyse Line Execution Times
- Autodetect Nuget Build Dependencies
- Build Priority
- Build Process Cpu Architecture
- Build Sdk
- Collect Control Flow During Execution
- Consider Inconclusive Tests As Passing
- Copied Project Dependencies
- Copy Referenced Assemblies To Workspace
- Custom Build Properties
- Data Storage File Size
- Default Test Timeout
- Detect Stack Overflow
- Enable Rdi
- Files Excluded From Auto Build
- Framework Utilisation Types
- Ignore This Component Completely
- Implicit Project Dependencies
- Include Static References In Workspace
- Instrument Output Assembly
- Method Data Limit
- Ms Test Thread Apartment State
- Preload Assembly References
- Prevent Signing Of Assembly
- Proxy Process File Path
- Rdi Cache Size
- Required Capabilities
- Restrict Tostring Usage
- Run Pre Or Post Build Events
- String Length Limit
- Track File Dependencies
- Use Build Configuration
- Use Build Platform
- Use Cpu Architecture
- Runtime Framework
- Overview
- Atomic Attribute
- Category Attribute
- Collect Control Flow Attribute
- Distribute By Capabilities
- Duplicate By Dimensions
- Enable Rdi Attribute
- Environment Class
- Exclusively Uses Attribute
- Inclusively Uses Attribute
- Isolated Attribute
- Method Data Limit Attribute
- Requires Capability Attribute
- Restrict Tostring Attribute
- Serial Attribute
- String Length Limit Attribute
- Timeout Attribute
- Uses Threads Attribute
- Global Configuration
- Troubleshooting
- Tools
- Keyboard Shortcuts
- Manual Installation Instructions
Engine Hosting Strategy
Global-level NCrunch configuration settingID/Tag in config file: EngineHostingStrategy
Purpose
From v2.11, NCrunch has the ability to host its engine outside the IDE process and share data with the IDE using memory sharing IPC.
This setting controls how NCrunch should host its engine. Note that changing this setting may require a restart of the IDE, as NCrunch cannot unload the engine from the IDE process after it has been initialised with the HostInsideIDE option.
Default Value
The default value of this setting depends upon the capability of the machine NCrunch is installed on.
On 64-bit machines with total memory of at least 5,368,709,120 bytes (5GB), this setting will default to x64SatelliteProcess.
For all other machines, this setting will default to x86SatelliteProcess.
Recommendations
Hosting the engine outside the IDE brings both advantages and disadvantages. In most cases, the advantages will outweigh the disadvantages. However, it is worth understanding the implications of satellite hosting and deciding whether it is suitable for your environment.
When the engine is hosted outside the IDE, NCrunch will attempt to minimise its IDE footprint as much as possible. The only code executed within the IDE will be that which is required to service the visual elements of NCrunch's UI and to push data to the engine which is only available inside the IDE (such as open documents, the list of open projects, NCrunch configuration, etc). All background processing is performed in the satellite process with necessary data being exchanged with the IDE using shared memory (IPC).
Hosting the engine in an x86 satellite process consumes less total memory than an x64 satellite process, as objects under .NET have a smaller memory footprint under x86. However, the x86 process has a memory ceiling of only 2GB, greatly limiting its scalability. For this reason, x86 hosting is recommended on machines with only a small amount of physical memory available.
Satellite hosting brings the following benefits:
- Memory allocated by NCrunch is mostly held in the satellite process, greatly reducing VS memory consumption and reducing the risk of OutOfMemoryExceptions and instability inside the IDE.
- The allocations/deallocations by NCrunch (memory traffic) are confined mostly to the satellite process. This greatly reduces the load on the IDE's garbage collector, which is often responsible for locking the VS UI during heap compaction when memory traffic gets too high.
- The NCrunch engine is able to operate with a higher memory ceiling (especially under x64 hosting). This allows the engine to scale further and leaves room for future feature development.
- If the NCrunch engine crashes, the satellite process is cleanly torn down and can be restarted from the IDE without taking down the IDE with it.
- If the IDE crashes, the NCrunch engine is able to perform a clean exit, saving any test and coverage data to its cache file.
- Less overall CPU is consumed because NCrunch does not need to perform extra work to exchange data between the engine and the IDE. Note that the work required to exchange this data is usually small compared to CPU consumed by executing tests and servicing the NCrunch engine.
- Slightly less overall memory is consumed because NCrunch does not need to reload its binaries into a separate process with its own memory space.
- The time taken to initialise the NCrunch engine is marginally lower because there is no need to spawn a new process.