Manage Your Windows .dmp files

By default, Windows creates a unique memory dump file when the system crashes unexpectedly. Depending on your system configuration, there are 2 types of memory dumps - full and mini - capturing the point-in-time contents of RAM memory when the incident occurs. The file size of the full memory dump matches working RAM memory set whereas the mini version contains only key information that could aid cause analysis and troubleshooting when you contact Microsoft support.

You can use the following PowerShell code to determine the number, size and location of memory dump files on your machine, and reclaim valuable disk assets accordingly.

$dmp = get-childitem c:\ -recurse -filter *.dmp -ea silentlycontinue
$tsize = 0.0
$dmp | foreach { $_.directoryname+”`t”+ `
$_.name+”`t`t”+$_.length; $tsize += $_.length }
$tsize
$tsize/1mb

#delete if no longer needed
$dmp | foreach { remove-item $_.fullname }

Sample output:

C:\Windows MEMORY.DMP 378553314
C:\Windows\Minidump Mini050808-01.dmp 271272
C:\Windows\Minidump Mini050808-02.dmp 271272
C:\Windows\Minidump Mini050808-03.dmp 271272
C:\Windows\Minidump Mini050808-04.dmp 271272
C:\Windows\Minidump Mini050808-05.dmp 271272
379909674
362.310098648071

Technorati tags: PowerShell

No Comments »

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.