Troubleshooting
Problem
Use this document to collect trace data for debugging a heap leak issue for activation group heap.
Activation group heap is a type of temporary storage that an application may use. If the heap owned by a job fills, this will result in MCH6903 F/#hmalcmi with an activation group mark that is not zero . See the following reference for additional details on this type of heap: Single Level Storage Heap
If the heap problem being investigated is not a leak, then consider using the debug memory manager to investigate. See these links:
If the heap problem being investigated is not a leak, then consider using the debug memory manager to investigate. See these links:
Resolving The Problem
PEX heap traces can be used to isolate which programs and procedures are allocating the most heap storage not being released. The heap must be reset before starting the trace when errors state that the heap is already full. The scope of the trace should be limited to the specific heap type, specific jobs, and in some cases by a specific heap address. The scope is important to limit the number of trace events and increase the amount of time the trace covers. A leak can be slow . Scoping the trace correctly reduces the size of the trace and allows for a longer period of time to be traced.These items must be known before beginning:
If the heap is already full, how can the heap be reset?
This depends on how the code uses the heap. Resetting the heap may be as simple as restarting a given job. But, if multiple jobs are failing at the same time, an IPL or special instructions may be needed to reset the heap.What jobs should be traced? A generic job group or a specific job needs to be identified.What type of heap is being used? Activation Group (*ACTGRPHEAP), Resident (*RESHEAP), System (*SYSHEAP), Handle (*HDLHEAP), Local (*LCLHEAP), User (*USRHEAP)? This document is specific to Activation Group Heap.- Is a filter by heap address required? This document is specific to not using a filter.
How long should the trace be run? Does the heap consumption happen over a period of hours or days?How will successful recreation of the problem be identified? This document assumes that an error message will be signaled or that the ACTIVATIONHEAPS macro will be used to sample and monitor the size of the heap for growth.
- Verify that required Performance Explorer (PEX) PTFs are applied:
http://public.dhe.ibm.com/services/us/igsc/idoctor/html/ptfs.html - Verify that the QMGTOOLS library is installed and current:
- ADDLIBLE QMGTOOLS
- GO MG
- Option 12: Display Build Date
- If the build date is more than one month old and the release is correct, update the tool using option 13: Check IBM for updated QMGTOOLS.
- If the QMGTOOLS library does not exist or the release is incorrect, install the tool using these instructions.
- Add the PEX definition for the generic job name or fully qualified job name:
For the JOB specify either a generic job name, JOB((*ALL/*ALL/generic* *ALL)), or a fully qualified job name, JOB((999999/job_user/job_name *ALL)).
ADDPEXDFN DFN(HEAP)
TYPE(*TRACE)
JOB((*ALL/*ALL/generic* *ALL)) or JOB((999999/job_user/job_name *ALL))
TASK(*ALL)
MAXSTG(4000000)
TRCTYPE(*SLTEVT)
SLTEVT(*YES)
MCHINST(*NONE)
STGEVT((*ACTGRPHEAP)) - Start the trace:
- The trace must be active before the heap becomes full.
- QMGTOOLS/STRPSC FUNCTION(*START)
LIBRARY(IBMPEX)
CLRLIB(N)
STRPEX(Y)
PEXDFN(HEAP)
PEXFILTER(*NONE)
SIZE(6)
PEX2KEEP(6)
JOBWATCHER(N)
CSI(N)
- Recreate the problem:
- Monitor for a period of time consistent with the time it take to experience the problem.
- Wait for the heap to grow significantly before stopping the trace.
- Monitor for errors or use the ACTIVATIONHEAPS macro to monitor for growth.
- Stop the trace:
QMGTOOLS/STRPSC FUNCTION(*DUMP) - Wait for the submitted job to complete.
- Analyze the data or send the data to IBM
- This document explains how to start the analysis using IBM iDoctor for IBM i: Heap Analysis
- Many heap issues are caused by application code logic and are not operating system defects.
- Analysis of the trace may require billable services.
Send the data to IBM:- Save the IBMPEX data library to a save file
- Upload the save file to the case using one of these methods:
Preferred Method: https://www.ibm.com/support/pages/qmgtools-ftp-data-ibm
Alternate Methods: https://https://www.ibm.com/support/pages/mustgather-instructions-sending-data-ibm-i-support
[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CI9AAM","label":"Performance-\u003EMustGather"}],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Version(s)"}]
Historical Number
587269612
Was this topic helpful?
Document Information
Modified date:
15 December 2022
UID
ibm16556998