Microsoft Dynamics AX Support

This blog contains posts by the Microsoft Dynamics AX Support teams Worldwide

AOS crash, hang or memory leak debugging tools

AOS crash, hang or memory leak debugging tools

  • Comments 2

When experiencing an AOS crash, hang, or memory leak it may be difficult to know what tools are available to you to assist in resolving the issue.  One of the keys to resolving AOS crashes, hangs, and memory leaks is to get a memory dump from when the issue occurs.  The memory dump will let us know what was in memory when the issue occurred and often times can point us to code, printers, and other environmental factors.  Below I have highlighted how you can use Procdump in each of the scenario’s to get a memory dump. 

 

Steps to run Procdump for AOS crashes

1.       Create a new folder to hold the ProcDump files (for example on the C drive create a folder called Procdump)

2.       Go to the following website and download ProcDump:  http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx

3.       Run procdump.exe and accept the license

4.       Open a command prompt window and switch to the folder from step 1.

 

**If you have UAC turned on then you need to run the command prompt as administrator.  That means going to start then all programs then accessories then right click on command prompt and select run as administrator.

 

5.       Use the following command to start the procdump process

procdump -e -ma ax32serv.exe aoscrash.dmp

 

**Note: If you have more than one AOS instance on the machine you will need to determine the process id of the AOS instance and then use that in the following command

procdump -e -ma pid# aoscrash.dmp

 

To find out the process id you can open task manager.  If you don't have the pid column you can go to view and then select columns.  Mark PID (Process Identifier) and click ok.  Then find the AOS instance you want to monitor and note the PID.  Another way to do this is to look in the application event log for the AOS startup.  This would be an eventid of 149 and it will show the AOS instance so you know for sure what one you are monitoring and the PID will be listed in the system info.  Therefore if my pid is 5876 I would run the following command:

procdump -e -ma 5876 aoscrash.dmp

 

  1. Once you start procdump you need to leave the command prompt open or you could shut down your AOS service.  That means you cannot logoff the machine .   Alternatively you can choose CTRL-C on the command prompt to detach from the AOS gracefully and then shut the command prompt.

 

Once your AOS crashes then you can submit the*.dmp file from the folder in step 1 to the Microsoft support team.   Note that the name of the file will actually include the date and time you started Procdump.  So the file name could look like aoscrash_100405_112502.dmp.

 

Steps to run Procdump for AOS Hangs

 

  1. Create a new folder to hold the ProcDump files (for example on the C drive create a folder called Procdump)
  2. Go to the following website and download ProcDump:  http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx
  3. Run procdump.exe and accept the license
  4. We need to find the process id for the ax32serv.exe that is hanging.  To do this open task manager.  If you don't have the pid column you can go to view and then select columns.  Mark PID (Process Identifier) and click ok.  Then find the AOS instance you want to monitor and note the PID. 

Another way to do this is to look in the application event log for the AOS startup.  This would be an eventid of 149 and it will show the AOS instance so you know for sure what one you are monitoring and the PID will be listed in the system info.

5.       Open a command prompt window and switch to the folder from step 1.

 

**If you have UAC turned on then you need to run the command prompt as administrator.  That means going to start then all programs then accessories then right click on command prompt and select run as administrator.

 

6.       Use the following command to start the procdump process

procdump -h -ma pid# aoscrash.dmp

 

**Note: If my pid is 5876 I would run the following command:

procdump -h -ma pid5876 aoscrash.dmp

 

  1. Once you start procdump you need to leave the command prompt open or you could shut down your AOS service.  That means you cannot logoff the machine .   Alternatively you can choose CTRL-C on the command prompt to detach from the AOS gracefully and then shut the command prompt.

 

Once your AOS hangs then you can submit the*.dmp file from the folder in step 1 to the Microsoft support team.   Note that the name of the file will actually include the date and time.  So the file name could look like aoscrash_100405_112502.dmp.

 

Steps to run ProcDump for AOS Memory Leaks

 

1) Create a new folder to hold the ProcDump files (for example on the C drive create a folder called Procdump)

2) Go to the following website and download ProcDump:  http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx

3) Run procdump.exe and accept the license if this is your first usage of procdump on this machine

4) Copy the following into notepad and save the file as MemoryThreshold.cmd into the directory where you installed ProcDump

 

procdump.exe -m 1400 -ma -n 1 ax32serv.exe c:\dumps\Mem1400.dmp

procdump.exe -m 1700 -ma -n 1 ax32serv.exe c:\dumps\Mem1700.dmp

procdump.exe -m 2000 -ma -n 1 ax32serv.exe c:\dumps\Mem2000.dmp

procdump.exe -m 2300 -ma -n 1 ax32serv.exe c:\dumps\Mem2300.dmp

 

5) Open a command prompt window and switch to the folder where you installed ProcDump (e.g.  C:\Procdump).  **

 

 **If you have UAC turned on then you need to run the command prompt as administrator.  That means going to start then all programs then accessories then right click on command prompt and select run as administrator.

 

6) If you have more than one AOS instance on the machine you will need to determine the process id of the AOS instance and then edit the MemThreshold.cmd file and replace the word ax32serv.exe with the process id of the AOS you want to trace against.

 

**To find out the process id you can open task manager.  If you don't have the pid column you can go to view and then select columns.  Mark PID (Process Identifier) and click ok.  Then find the AOS instance you want to monitor and note the PID.  Another way to do this is to look in the application event log for the AOS startup.  This would be an eventid of 149 and it will show the AOS instance so you know for sure what one you are monitoring and the PID will be listed in the system info.

 

7) If you want to change memory thresholds from the default of 1400, 1700, 2000, and 2300 MB of private bytes, you can also edit the MemThreshold.cmd file and change those memory values.

**Please note that if you are on a version before Dynamics AX 2009 you should use the values 1200, 1400, 1600, 1800

 

8) The default path for saving the dump files is c:\dumps – if you need to change that path, please edit the MemThreshold.cmd file and change the path for each line.

 

9) To start the tracing process, make sure your MemThreshold.cmd file is saved, and from the command window which should be set to the directory where you installed ProcDump.  Type in MemThreshold and press Enter. Your command window should show some information about what is being traced and then will pause waiting for the threshold to be reached. Once the first limit has been reached, the batch will automatically proceed to the next line and next memory threshold.

 

10) Once you start procdump you need to leave the command prompt box open.  That means you cannot logoff the machine as that would result in the memory dump not being collected and your AOS service to shut down.

 

11) If you need to stop procdump without impacting the running AOS you can use ctrl-C in the command window to stop the batch.

 

After a memory threshold has been reached you can submit the*.dmp file from the folder in step 1 to the Microsoft support team.

Leave a Comment
  • Please add 5 and 6 and type the answer here:
  • Post
  • Is this still true for 2012?  Or are there better ways to debug AOS crashes?

  • The same techniques would work, this was just an example of one tool - for other options, please see this post.  Same concept different tools -

    blogs.msdn.com/.../what-to-do-if-you-have-a-crash.aspx

Page 1 of 1 (2 items)