How to generate application dumps using Debug Diag for Crashes / Performance Triggers ?
Memory Dump Files (.dmp files) are a snapshot of a program’s memory at a given time. With a dump file, you can see the current executing lines of code, the values of local values and values of all the heap objects. In other words, a dump file represents the entire state of the program at the point it was captured.
Dumps are usually used to debug crashes (Crash Dumps), but there are other uses as well. From most common to least they are:
- Debug crashed programs
- Debug hung programs
- Find memory leaks
- Debugging on a different machine or at a different time
- Debug programs that can’t be attached with a debugger
Installing Debug Diag:
Download DebugDiag - from here and install it on the machine
Generating a Crash Dump for a Process / Application
- Run DebugDiag Collection
- In the Wizard select 'Crash'
- Press 'Next'
- Select 'A specific process'
- Select your Process / Application Pool / Service
- Advanced Configuration (Optional)
- Unconfigured First Chance Exceptions - Provide instructions on what to do if the process hits an Exception different from the one configured in our rules. We will leave it blank
- Action limit for unconfigured First Chance Exceptions - How many actions are executed upon the Exception
- Maximum number of userdumps created by this rule - Number of dumps generated before rule is inactive
- Click 'Advanced Settings > Exceptions...'
- 'Add Exception...'
- In the Configure Exception add your Exception from the crash event in EventViewer along with what action should be done and how many times
- Press 'OK'
- 'Save and Close'
- Press 'Next'
- Name the rule and Select folder where the dump should be stored
- Press 'Next'
- 'Activate the rule now'
- Press 'Finish'
- Keep DebugDiag Collection Open
- Run the flow that replicates the issue
- Collect the Dump
Generating a User Dump for an IIS process once performance indicators are exceeded (For example % of 500 exceptions)
- Run DebugDiag Collection
- In the Wizard select 'Performance'
- Press 'Next'
- Select 'Performance Counters'
- Press 'Next'
- Click 'Add Perf Triggers...'
- Under Add Counters select the performance indicators and their targets
For example we will be targeting the UiPath_Orchestrator instance and using the W3SVC_W3WP > % 500 HTTP Response Sent because we want to trigger it when the server starts pushing more than a specific amount of 500s. - Press 'OK'
- Click the newly added counter and press Edit Thresholds...
- In the properties add the specifics of what the faulty behavior would be. For example a 10% percentage of 500 during 2 minutes is considered faulty here.
Remember to baseline against normal operation.
- Press 'OK'
- Press 'Next'
- In the Select Dump Targets target the process whose dump we will be taking. For example we could measure the performance of another app to target a dump of the Orchestrator.
- In our case we will be targeting the AppPool
- Press 'OK'
- Press 'Next'
- Configure UserDump Series according to your debugging needs
- Name the rule and Select folder where the dump should be stored
- Press 'Next'
- 'Activate the rule now'
- Press 'Finish'
- Keep DebugDiag Collection Open
- Run the flow that replicates the issue
- Collect the Dump