Memory Dump File Concepts
Memory Dump File Concepts
Abstract
This white paper describes memory dump files, the tools that are used to collect them, and
the techniques that support engineers use to troubleshoot the processes that Exchange
relies on.
The information contained in this document represents the current view of Microsoft Corporation on the issues
discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it
should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the
accuracy of any information presented after the date of publication.
This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR
IMPLIED, AS TO THE INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under
copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for
any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights
covering subject matter in this document. Except as expressly provided in any written license agreement from
Microsoft, the furnishing of this document does not give you any license to these patents, trademarks,
copyrights, or other intellectual property.
INTRODUCTION........................................................................................................... 1
CONCLUSION............................................................................................................ 13
APPENDIX A.............................................................................................................. 15
APPENDIX B.............................................................................................................. 17
APPENDIX C.............................................................................................................. 19
APPENDIX D.............................................................................................................. 20
INTRODUCTION
This white paper provides general guidelines for troubleshooting certain
problematic scenarios. Do not assume that the steps that this white paper
provides are the only methods that you have to use to troubleshoot any problem.
Some circumstances may require more than one approach to determine the root
cause of a problem.
Additionally, memory dump files are not always the best way for a support
engineer to determine the root cause of a problem. Sometimes a memory dump
file helps direct the troubleshooting, but does not point out the exact root cause
of all problems. In those cases, additional troubleshooting steps must be used.
Such additional steps may include using other tools or diagnosis techniques.
The information in this white paper is not intended to supersede the judgment of
a PSS support engineer who is diagnosing a problem.
Heap memory. This information includes objects or variables that are created
by a process which is using statements in C++ such as "free," or "malloc" in
C. Heap memory is generally used to determine what data was loaded at the
time that the memory dump file was collected.
Call stacks for all threads. These call stacks contain all the function calls that
were being processed at the time that the memory dump file was collected,
together with the variables that were on the stack. Call stacks are used to
determine what was happening at the time that the memory dump file was
collected.
Assembly code. The assembly code that each process is executing is loaded in
virtual memory. A memory dump file can capture that assembly code, and a
support engineer can use that code to help debug the problem so that the
support engineer can determine how variables or processor registers reached
their current state.
Module information. Most processes use multiple files when they are
executing. For example, many DLL files are frequently used to load supporting
libraries for a process. A process might contain files that were created by
Microsoft or by other companies. A memory dump file captures information
Differences between full memory dump files and mini memory dump
files
A memory dump file can collect a variety of information. Typically, a support
engineer must have all the contents of virtual memory to troubleshoot a problem.
In other cases, you might want to capture less information to focus on a specific
problem. The debugger is flexible. This flexibility lets you limit the information
that a memory dump file captures by collecting either full memory dump files or
mini memory dump files:
Full memory dump files. These files contain the contents of virtual memory
for a process. These files are the most useful when you are troubleshooting
unknown issues. A support engineer can use these files to look anywhere in
memory to locate any object, pull up the variable that was loaded on any call
stack, and disassemble code to help diagnose the problem. The disadvantage
of full memory dump files is that they are large. It also may take additional
time to collect these files, and the process that is being recorded must be
frozen while the dump file is created.
Mini memory dump files. A mini dump file is more configurable than a full
dump file and can range from only several megabytes (MB) up to the size of a
full dump file. The size differs because of the amount of virtual memory that
the debugger is writing to disk. Although you can gather mini memory dump
files quickly and they are small, they also have a disadvantage. Mini dump
files may contain much less information than full dump files. The information
that a mini dump file gathers may be virtually useless to a support engineer if
the area of memory that the support engineer has to troubleshoot was not
captured. For example, if the heap memory is not written to the memory
dump file, a support engineer cannot examine the contents of a message that
was being processed at the time that the problem occurred. Useful
information, such as the subject line and the recipient list, would be lost.
The tools that PSS support engineers use most frequently are:
Dr. Watson. This tool is a "just in time" debugger. Dr. Watson creates
User.dmp files for a process whenever a second chance, unhandled exception
is encountered. In most circumstances, a second chance, unhandled
exception occurs because of an access violation, a stack overflow, or some
condition that an application was not written to handle.
ADPlus. This is a script that uses the CDB debugger to capture virtual
memory. ADPlus can be configured to create memory dump files when
hardware fails or a process stops responding. ADPlus has additional flexibility;
it can capture multiple processes with one command-line instruction. ADPlus
has two modes of operation: Hang mode and Crash mode:
Note This white paper describes how to use the Adplus utility to configure
the debugger to collect memory dump files. You can also use the Windows
Debugger, but the syntax that you must use is more complex and beyond the
scope of this white paper. Therefore, the equivalent Windows Debugger
commands are not included for the examples in this white paper.
Note All the examples in this section assume that the Debugging Tools for
Windows are installed on the Exchange server. To install the Debugging Tools for
Windows, visit the following Microsoft Web site:
http://www.microsoft.com/whdc/devtools/debugging/default.mspx
It is recommended that you install the Debugging Tools for Windows to the
c:\debuggers folder if you can. Installing to this folder makes executing
command line instructions easier.
2. Change to the folder where the Debugging Tools for Windows are
installed. (By default, this folder is C:\Program Files\Debugging Tools for
Windows.)
4. Adplus informs you that a memory dump file is being created. Click OK to
continue.
6. Wait for approximately three minutes, and then repeat step 3. This
creates another mini memory dump file in a new subfolder of the location
where the Debugging Tools for Windows were installed. You will have two
subfolders, and each subfolder will contain a mini memory dump file.
7. Wait for approximately three minutes longer, and then type the following
command-line instruction:
This creates another subfolder, but this time a full memory dump file is
created for the process.
8. Collect all three of the subfolders that were created, and then use the
instructions in Appendix D to send the subfolders to PSS.
Note PSS may also request additional information, such as system monitor logs
and event logs, to troubleshoot the problem.
In these situations, support engineers typically must have multiple dump files, so
that they can examine the state of the threads at different points in time. Getting
a snapshot of what is occurring over the course of several minutes helps reveal
whether a process has stopped responding, or whether the threads are just
processing slowly. The difference is significant because it determines the direction
that the troubleshooting takes moving forward.
Collecting memory dump files for performance problems can take longer than
usual if a lack of system resources causes a process to run more slowly than
usual. Also, because collecting a memory dump file itself requires system
resources, the server needs time to recover from the memory dump file creation
process. Therefore, the performance of the server immediately after you create a
memory dump file, especially a full memory dump file, should not be considered
typical performance behavior. Typical performance behavior returns after the
process catches up from creating the dump file.
The following example uses ADPlus to capture memory dump files when a
process is experiencing a performance problem:
2. Change to the folder where the Debugging Tools for Windows are
installed. (By default, this folder is C:\Program Files\Debugging Tools for
Windows.)
4. Adplus informs you that a memory dump file is being created. Click OK to
continue.
7. Wait for approximately three minutes longer, and then type the following
command-line instruction:
8. This creates another subfolder, but this time a full memory dump file is
created for the process.
9. Collect all three of the subfolders that were created, and then use the
instructions in Appendix D to send the subfolders to PSS.
Note PSS may also request additional information, such as system monitor logs
and event logs, to troubleshoot the problem.
Crashes
A crash occurs when a condition arises that the exception handlers for the
process and the operating system cannot handle. Access violations, heap
corruption, stack corruption, or a stack overflow may lead to a crash. By design,
a crash creates one dump file at the time of the crash, and it is possible that the
dump file can be used to isolate the root cause. Sometimes you may have to
capture another memory dump file of the crash. For example, a support engineer
may require more or different memory dump files from the time of the crash if
the memory dump file was corrupted and is unreadable, or if other factors also
lead to the crash.
drwtsn32
Number of Instructions: 10
drwtsn32 –i
You receive a notification that Dr.Watson has been registered as the default
application debugger. Click OK to clear that notification.
You can also configure the debugger to catch crashes by using ADplus or the
Windows Debugger. Those options give you more control of what type of memory
dump file is created and what the name of the memory dump file will be.
The advantage of using Dr.Watson to catch crashes is that the debugger does not
have to be invasively attached to a process to capture a crash. The
disadvantages are that the same file name is always used (User.dmp), and the
information in the User.dmp file will be overwritten if another crash occurs. Also,
Dr.Watson does not capture first-chance exceptions.
To overcome the limitations of Dr.Watson, you can use ADPlus, the Windows
Debugger, or CDB to make collecting memory dump files from processes that
have crashed easier. The following example uses ADplus to configure the
debugger to catch a crash in a process:
2. Change to the folder where the Debugging Tools for Windows are
installed. (By default, this folder is C:\Program Files\Debugging Tools for
Windows.)
5. A full memory dump file is created if any one of the following situations
occur:
6. The memory dump file is created in a subfolder of the location where the
Debugging Tools for Windows were installed. The subfolder name is
similar to "Crash_Mode__Date_[MM-DD-YYYY]__Time_[HH-MM-SS]PM."
Memory leaks
A memory leak is created by code that creates objects in virtual memory but
does not remove those objects when the code finishes using them. For example,
if a process is opening messages in the store process to scan those messages for
viruses, and that process continually opens messages for scanning but never
closes them, virtual memory for the store process increases and is never
released. A support engineer can use a full memory dump file of a process that is
leaking memory to examine the contents of the heap and determine what types
of objects are being leaked and which user logon owns them. In this example,
one dump file may be sufficient to capture the leak, but if the leak is small or
slow to develop, a support engineer may require multiple dump files to examine
the contents of virtual memory. Other tools, such as LeakDiag, UMDH, VADump,
and System Monitor, are typically employed to diagnose a leak.
2. Change to the folder where the Debugging Tools for Windows are
installed. (By default, this folder is C:\Program Files\Debugging Tools for
Windows.)
4. Adplus informs you that a memory dump file is being created. Click OK to
continue.
6. Collect the subfolder that was created, and then use the instructions in
Appendix D to send the subfolder to PSS.
Note PSS may also request additional information, such as system monitor logs
and event logs, to troubleshoot the problem.
You can use the Windows Debugger to create a new mini memory dump file that
is based on the full memory dump file.
3. Open the full memory dump file that captured the process at the time of
the failure.
6. Wait until you see the debugger report "Dump successfully written."
7. On the File menu, click Exit. If you are prompted about whether you
want to save workspace information, click No.
Make sure that you also upload the full memory dump file to PSS. PSS will
probably also need the full memory dump file to complete a detailed investigation
of the problem.
There are two general types of memory dump files: full memory dump files and
mini memory dump files. Full memory dump files contain all the contents of
virtual memory for a process. Mini memory dump files may contain much less
information than full memory dump files, but mini memory dump files are faster
to collect and smaller than full memory dumps.
In any case, support engineers strive to minimize the impact that gathering
memory dump files has on a customer while still trying to collect all the
information that they must have to troubleshoot a problem.
http://support.microsoft.com/default.aspx?pr=exch2003
http://support.microsoft.com/default.aspx?pr=exch2k
http://www.microsoft.com/exchange/
For additional information about how to collect memory dump files and scenarios
where memory dump files can be useful on Exchange Server 2003 computers and
Exchange 2000 Server computers, click the following article numbers to view the
articles in the Microsoft Knowledge Base:
The main body of this white paper contains information about collecting mini
memory dump files. This information is also included in the following table. Some
of those points are restated in this appendix for clarity.
The table includes preferred options and secondary options for both a process
that stops responding (hangs) and slow performance. The preferred options
involve gathering several full memory dump files during the problematic
condition. This option is preferred because support engineers can use all the
contents of virtual memory for a running process to investigate the problem. This
helps the support engineer examine the objects that were being used at the time
that the problem occurred.
The secondary options involve gathering one full memory dump file, and then
gathering at least two more mini memory dump files during the problematic
condition. The disadvantage of the secondary option is that the mini memory
dump files will not contain the objects that were being used during the
problematic condition. The support engineer might be able to use the data in the
full memory dump file to locate objects that are referenced in the mini memory
dump file, but that may not be possible.
Another significant difference between the preferred option and the secondary
option is the time that it takes to complete them. Full memory dump files take
several minutes longer to create than mini memory dump files. Therefore, the
time that it takes to complete the preferred option is longer than the time that it
takes to complete the secondary option by at least several minutes. The time
difference depends on the amount of virtual memory that a process is using at
the time that the memory dump file is collected.
From a memory dump file, you can verify that multiple threads are backed up
behind one thread. In the following example, thread 102 is blocking the others.
After you have this information, you must determine what thread 102 doing. To
determine what thread 102 is doing, view that call stack.
ChildEBP RetAddr
NTDLL!ZwReadFile+0xb
KERNEL32!ReadFile+0x125
MSExchange!OpIFSRead+0x84
MSExchange!OpRead+0x413
MSExchange!IStreamRTF::Read+0x1b
inetmail!CStreamLockBytes::Read+0x43
inetmail!CInetStream::_HrGetNext+0x33
inetmail!CMessageTree::_HrBindOffset+0x71
inetmail!CMessageTree::Load+0x5e
MSExchange!CConverter::Initialize+0x229
MSExchange!CIMailConvert::HrOpenProperty+0x88
MSExchange!MSG::OpFurnishProp+0x539
MSExchange!MSG::OpGetBasicProp+0x16f
exlib!RPC_INTERFACE::DispatchTo+0x5e
exlib!OSF_SCALL::Dispatch+0xac
exlib!LOADABLE_TRANSPORT::ProcessIO+0x14a
exlib!ProcessIOWrapper+0x9
exlib!BasOpachedThread+0x4f
exlib!ThreadStart+0x18
KERNEL32!ThreadStart+0x52
From this call stack, you can verify that this thread was trying to read a file from
disk. This information is recorded at the top of the stack, where the store called
IFSRead, which called into ReadFile.
This is useful information, but you cannot be sure that the problem is only a disk
performance problem. Next, you must determine what type of data was being
read from the file at the time. In this case, this stack is processing a rule. For
example, you know that you are doing work in the following folder.
At this point, the information indicates why the server is performing slowly or has
stopped responding, but you do not know for sure. You know that at one moment
this thread was in ReadFile. That is not sufficient information to confirm that you
have a disk performance problem.
When you obtain the three snapshots of memory, if they show that your threads
are no longer backed up but the problem persists, you can examine all the
threads to determine what was happening that caused the process to stop
responding. You can use System Monitor logs and event logs to help gain a better
understanding of why the threads are in this state, and why the process stopped
responding.
Typically, PSS asks for multiple dump files because PSS support engineers have
to know what the threads are doing at the time of failure during multiple
moments in time.
1. You will receive an e-mail message from your support engineer at Microsoft.
The e-mail message will contain a Web site address, or Uniform Resource
Locator (URL).
2. Your support engineer will contact you again, either by e-mail message or
telephone, to give you a password:
Files will only remain at the Web site address for 24 hours. If you
do not retrieve your file in 24 hours, it will be deleted. If this occurs,
please contact your support engineer and ask to the have the files sent
again.
3. Start your Web browser, and visit the Web site address that your support
engineer provided in the e-mail message.
5. Type the password that your support engineer provided, and then click GO.
You are given access to the location that contains the files that you want.
6. Right-click the file name, and then click Save Target As.
7. In the Save As dialog box, select the destination path on the computer where
you want to save the file, and then click Save. Click Close to close the dialog
box. The file is copied to that destination.
8. If you have multiple files in this location, repeat steps 6 and 7 to make sure
that all the files are copied.
9. Although Microsoft takes precautions to help make sure that the files we send
are clean of any viral infection, always use your antivirus vendor's software to
scan the files to help make sure that no infection exists. In the unlikely event
that your antivirus software detects an infection, please contact the Microsoft
support engineer who you are working with.
10. When you have received your files, exit the Web browser to close your
session.
Important If you click any .txt, .htm, .html, or .jpg files, the file may
automatically be displayed in the Web browser. For files that have these
extensions, right-click the link, and then click Save Target As to save the file. If
the file is large, the system may hang, depending on the capacity of the hard
disk on your computer.
1. You will receive an e-mail message from your support engineer at Microsoft.
The e-mail message will contain a Web site address, or Uniform Resource
Locator (URL).
2. Your support engineer will contact you again, either by e-mail message or
telephone, to give you a password.
Files will only remain at this location for 24 hours. If for some
reason your support engineer does not download your file in 24 hours, it
will be deleted. If this happens, you may be asked to send the file again.
3. Start your Web browser, and then visit the Web site address that your
support engineer provided in the e-mail message.
6. Click Browse, locate the file that you want to send, and then click Upload. If
you need to send an additional file, click Send, and then repeat the process.
7. When you finish sending your files, quit your Web browser to close your
session.
Important Do not upload a file that is larger than 1.93 GB. If you try to upload
a file that is larger than 1.93 GB, the upload will fail. If you have to transfer a file
that is larger than 1.93 GB, please contact your support engineer.
Question: What is the hard disk drive space requirement for receiving files?
To receive files from Microsoft, available hard disk drive space must be
double the size of the file that is being received.
All authentication and transfers with the PSSFTA application use industry
standard Secure Sockets Layer (SSL). To learn more about Secure
Sockets Layer, visit the following Microsoft Web site and examine the
"Understanding SSL" section:
http://www.microsoft.com/technet/treeview/default.asp?
url=/technet/prodtechnol/iis/maintain/featusability/c06iis.asp
Question: I cannot access my folders any longer and the application says my
password is invalid. What happened?
All folders are removed every 15 days unless your support engineer
receives an extension for that folder to continue resolving your support
issue. The folders that the PSSFTA uses are designed to be used for an
individual support issue. If you have to transfer files that are related to
other issues to and from your support engineer, your support engineer will
create additional folders for you.
Question: What operating systems and Web browsers has the PSSFTA
application been tested with?
This application has been tested with the following operating system and
Web browser combinations:
o Macintosh with Microsoft Internet Explorer 5.1.x for Macintosh
o Macintosh with Microsoft Internet Explorer 5.2.x for Macintosh
o Microsoft Windows 2000 with Microsoft Internet Explorer 5.0
o Windows 2000 with Microsoft Internet Explorer 5.5
o Windows 2000 with Microsoft Internet Explorer 6
o Microsoft Windows 98 with Microsoft Internet Explorer 5.0
o Windows 98 with Microsoft Internet Explorer 5.5
o Windows 98 with Microsoft Internet Explorer 6
o Windows 98 with Netscape 4
o Microsoft Windows Millennium Edition (Me) with Microsoft Internet
Explorer 5.5
o Microsoft Windows NT 4.0 with Microsoft Internet Explorer 5.0
o Microsoft Windows XP Professional with Microsoft Internet Explorer
6
Question: What do I do when the file upload page is expired?
If this happens, please start again from the beginning; visit the Web page
that the Microsoft support professional provided, type the provided password,
click Send Files to Microsoft, and then click Go.