KEMBAR78
ABAP Memory Inspector Guide | PDF
0% found this document useful (0 votes)
34 views8 pages

ABAP Memory Inspector Guide

The document discusses how to use the ABAP Memory Inspector tool to analyze memory consumption in ABAP programs. It describes how to create memory snapshots, view the snapshots using transaction S_MEMORY_INSPECTOR, and compare snapshots to identify memory usage over time or between runs. An example is provided to demonstrate analyzing memory usage of a sample program.

Uploaded by

zhjint
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views8 pages

ABAP Memory Inspector Guide

The document discusses how to use the ABAP Memory Inspector tool to analyze memory consumption in ABAP programs. It describes how to create memory snapshots, view the snapshots using transaction S_MEMORY_INSPECTOR, and compare snapshots to identify memory usage over time or between runs. An example is provided to demonstrate analyzing memory usage of a sample program.

Uploaded by

zhjint
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ABAP Memory Inspectors

 4  8  8,083

The amount of memory an ABAP program consumes depends on the amount of data being processed, which is
typically stored in some type of in-memory structure (such as internal tables) that grows dynamically to
accommodate the stored data. If the amount of stored data to be loaded into system memory exceeds the size of
available storage area, the program terminates, possibly with the runtime errors such as SYSTEM_NO_ROLL or
TSV_TNEW_PAGE_ALLOC_FAILED.

Because these errors can arise for a variety of reasons, the root cause may not be immediately obvious .For
example, the runtime error TSV_TNEW_PAGE_ALLOC_FAILED occurs when the system can’t increase the size of
an internal table due to insufficient available memory. However, this internal table might not be the reason why
memory is exhausted. What you need in this situation is a tool to help you determine the real reason that the
application has run out of memory.

The ABAP Memory Inspector provides you with an overview of dynamically allocated data (that is, all dynamic in-
memory structures) at a particular time, which can be very helpful for diagnosing memory consumption problems,
as well as a specialized transaction for analyzing this data.

Using the ABAP Memory Inspector

Analyzing the memory consumption of an application typically consists of two types of scenarios:

You’re interested in the current memory consumption of a running program in order to check if it is
unexpectedly high.

You want to compare the memory consumption of a program at different times in order to find out if it increases
in an undesirable way and to identify which memory objects contribute to the increase.

Creating the Memory snapshots

There are several ways to create a memory snapshot:

When debugging an application, select Development->Memory analysis->Create Memory snapshots from the
ABAP debugger menu bar .A completion message indicates when the file is ready.
Enter the command /hmusa in the command field on any SAPGUI screen –you don’t need to be in the
debugger .When the file is ready, you will see the same completion message shown for the previous option.

Analyzing and Comparing Memory Snapshots

The ABAP Memory Inspector provides a dedicated transaction for displaying the content of stored memory
snapshots.

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
You start this transaction via S_MEMORY_INSPECTOR, or Memory analysis ->Compare Memory snapshots from
the menu bar.

For Example:

Lets say you want to analyze the memory consumption of some program (demo program : ZTEST_MEMORY)

Run the report ZTEST_INDEX

You will get the output as below.

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Now enter /hmusa in the command field.

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Message will be displayed at the bottom indicating that memory snapshot is created.

To the view the memory snapshot go to the transaction S_MEMORY_INSPECTOR.

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Double-click on an entry in the list to open a screenshot and display its contents in the lower part of the screen.
You can have up to two snapshots open at one time. Opening a third snapshot automatically closes one of the
others based on the difference in creation time. The first opened snapshot is referred to as (t_0);second as (t_1)
.To select an open snapshot for display ,use the (t_0) and (t_1) buttons in the application at the top of the screen,
or use the Memory Snapshot dropdown list located above the display tree in the lower part of screen.

Alert Moderator

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Assigned Tags

ABAP Development

abap

labs india

Similar Blog Posts 


New Memory Analysis Features in NetWeaver 7.0 EHP2
By Former Member Mar 24, 2011

Overview of SAP GUI-based ABAP Troubleshooting Tools


By Olga Dolinskaja Dec 08, 2016

ABAP Test Cockpit – an Introduction to SAP’s new ABAP Quality Assurance Tool
By Olga Dolinskaja Sep 19, 2012

Related Questions 
Replacing Global "DEFAULT" variant in Code Inspector with custom variant
By Former Member Dec 13, 2006

Runtime Error: : TSV_TNEW_PAGE_ALLOC_FAILED


By Naveen Srinivasa Apr 21, 2016

When do you use these tools ?


By Malcolm Clark Jan 30, 2009

4 Comments

You must be Logged on to comment or reply to a post.

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Former Member
March 12, 2014 at 6:54 am

Hi,

Thanks for sharing this useful tip.

two comments:

1. Both classic ABAP Debugger and New ABAP Debugger have also built-in memory analysis tool:

In classic debugger, you may choose the menu option by choosing the menu option Goto -> More screens -
> Memory usage.

In new debugger, you may add the Memory Analysis tool (under Memory Management).

You may read about the new features of the New Deubbger in New Memory Analysis Features in NetWeaver
7.0 EHP2 byStephen Pfei er.

2. In the New ABAP Debugger, Development->Memory analysis->Create Memory snapshots menu isn't
available anymore. You may create memory snapshots via the services of Memory Analysis tool.

Alternatively, you can always use /hmusa (or menu System -> Utilities -> Memory Analysis -> Create
Memory Snapshot).

Like 0 | Share

Jayashree Desai | Blog Post Author


March 12, 2014 at 6:59 am

Hi ,

Thanks a lot for sharing the details.

Regards,

Jayashree

Like 0 | Share

Gaspar Zoltan Erdelyi


June 17, 2020 at 10:21 pm

THere is also a way to create the snapshot from ABAP code, by calling
cl_abap_memory_utilities=>write_memory_consumption_ le( )

Like 1 | Share

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Balint Szebenyi
March 11, 2021 at 5:38 am

This class was a helpful addition, thanks!

Like 0 | Share

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com

You might also like