How to run SAP transaction ST02 and do performance analysis in SAP memory/buffer area

SAP transaction ST02 can be used to view SAP Buffer and memory configuration for a SAP instance and review SAP memory quotas for individual user job or process as well as current SAP buffer status, SAP memory utilization at SAP instance or user/transaction level. This post would cover following areas:

1. How to run SAP memory usage monitor and navigate through important ST02 screens.

2. How to understand SAP ST02 screens: main/summary screen or SAP memory Quota screens etc.

3. How to use SAP ST02 to do SAP memory and buffer performance analysis.

1. How to run SAP Memory/Buffer monitor and navigate through important screens of the monitor

1.1 How to start SAP Buffer/Memory monitor

To start SAP Buffer/Memory monitor, you can either use menu path or run sap transaction ST02 directly. This would show buffer/memory configuration and usage for the instance where the SAP ST02 is started. After you execute SAP transaction ST02, SAP buffer and memory overview/status screen would show up:

Figure 1 – ST02 memory overview/summary

You can refresh the screen to show new status, Except Curr. Use and MaxUse, all other non-configuration data are accumulated data since last startup of the SAP instance in question.

1.2 How to navigate through important screens of the SAP ST02 transaction.

Following screen shows menu path and hot key which you can use to access other SAP st02 screens:

In following sections, I would mention some important screens which I use most often.

1.2.1 How to review SAP Buffer and Memory for another instance of the SAP system

If your system has more than one instance, you can display to another instance via following path from figure-1 screen: Environment -> RFC server or press shift+F4 key until a popup window shows up with a list of instance, you can click the one you would like to review.

1.2.2 How to navigate to SAP quotas screen – SAP memory allocation for a single work process

SAP ST02 Quota screen shows type of memory and amount allowed for a single SAP work process as well as memory allocation sequence. There are two sequences – one is for dialog type tasks like online transaction executed by a SAP user, the other is for non-dialog tasks like SAP SM37 jobs.

You can get the memory quota screen for single sap work process via menu Goto->SAP memory-> Quotas:

Figure 2 ST02 – memory quotas for a work process

1.2.3 How to navigate to mode list screen showing memory usage at user/transaction level

You can bring up mode list screen from main screen (Figure 1) via following path: Details analysis menu -> SAP Memory -> Mode list

Figure 3 – Memory usage by SAP users

1.2.4 How to navigate to SAP memory history screen

SAP ST02 provides you history memory usage information. You can access this information via following menu path or hot keys from the memory initial screen.

Following is a part of history screen :

Figure 4 – ST02 History data

If you are just interested in buffer history for one buffer type, you can double click the corresponding row in Figure-1 screen –the screen would change, on the new screen click on History Icon, SAP ST02 would bring up history screen just for the selected buffer type.

History information can reveal abnormal memory usage as well as high-water mark namely “Maximum Usage” since the date when instance is started or restarted. SWAP difference between two dates can show the growth pattern –base on that, you can see whether action is needed to correct the situation.

1.2.5 How to navigate to parameter screen

You can check SAP memory/buffer parameters via Icon or following the menu path: Goto-> Profile Parameters -> Current.

Following is a part of SAP memory/buffer parameter screen:

You can select a profile parameter and change it. But the change would only come into effect after the instance is bounced. SAP has a tool to allow you to change SAP memory parameters(Extended Memory and Heap memory) dynamically –this means that your change would become effect immediately.

2. Explanation on SAP ST02 screens

Here I would explain several frequent referred ST02 screens to help you understand the data presented by SAP ST02 transaction.

2.1 SAP buffer and memory overview/summary screen

ST02 overview screen show information at instance level and has several sections:

  • Top shows instance name, instance startup date and snap-shot of date time.
  • Buffer section shows different SAP buffer configuration and current status.
  • SAP Memory section shows SAP memory configuration and current status.
  • Call Statistics shows database access information.

I have not encountered a performance case which I need “Call Statistics” data to do analysis, It looks like straightforward. From performance point view, buffer sections and SAP memory section is more critical – that is what I am going to cover in following sections.

2.1.1 Buffer section explanation

Column field explanation

Screen Field Explanation
Buffer Type of buffer like nametab, Program etc.
Hitratio % Namely buffer quality =( total access – physical access)/ total access x 100%.
Alloc. KB Configured or allocated memory space for the buffer type in question.
Freesp. KB Free space = allocated memory space – occupied memory space.
Dir. Size Maximum number of buffer object that can be kept in the related buffer.
FreeDirEnt Free Directory Entry = Directory Size – used Dir Entry.
% Free Dir = free Directory / Dir. Size X 100%.
Swap Number of buffered objects which has been swapped to page area.
DB Access Number of data transfers from the data base to the related buffer.

A great book on SAP performance – SAP Performance Optimization Guide: Analyzing and Tuning SAP Systems, SAP Basis, SAP Administration

2.1.2 SAP Memory section explanation

This section shows configured memory/virtual memory for a list of sap memory type and their memory usage.

Column Explanation
Sap Memory Show type of SAP memory
Curr. Use % = allocated memory/total-memory X 100% for the type of memory in question
CurrUS[KB] Currently used memory at the instance
MaxUse[KB] High-water mark since the SAP instance is started
In Mem[KB] Configured total memory
OnDisk[KB] Configured disc space(Virtual memory),only eligible for Page memory and roll memory.
SAPCurCache SAP Cursor Cache
HitRatio Applicable for ID and statement Caches.

2.2 SAP Memory Quotas screen

Column Explanation
texts Sap tasks type like dialog, background etc.
Step Sequence allocation – next memory area only if memory allocated in previous steps is not enough.
Memory type 3 possible memory types under current SAP design: Roll, Extended and Heap
Amount Configured the memory size for the tasks.

The SAP screen quotas screen (see figure 2) answers the question of what is maximum memory a SAP process can use:

  • Dialog tasks can use memory up to an amount <=Roll + Extended + Roll + Heap. Transaction executed online by SAP user is a dialog tasks.
  • Non-dialog tasks can use memory up to an amount <=Roll + Heap + Extended. SM37 background job is a non-dialog task.

Dialog tasks are executed in SAP Dialog work process. RFC calls and online transactions are executed in dialog work processes. Job, update and spool are non-dialog tasks. Jobs are executed “BGD” SAP work processes. Update tasks are executed in SAP “UPD” work processes. SAP transaction SM50/SM66 is a work process monitor. Click how to run SAP SM50/SM66 transaction to know more about SAP work process and monitor.

2.3 SAP mode list screen

Figure 3 screen shows SAP Memory usage for every external session by every logon user who is in the instance.

Column Explanation
user Sap user –same user might have more than one entries
EM used Extended Memory used by a user session in KB
Heap Heap memory used by a user session in KB
Other columns like “I-mode G1” etc I have not found the need to use those columns for SAP memory analysis.

Mode list has two sections – the upper section show current status, the lower section shows history information.

3. SAP ST02 transaction and memory analysis

Here I would focus on SAP Buffer and SAP memory.

3.1 SAP Buffer analysis

SAP Buffer analysis is to focus on following items

  • Hit rate: should not be lower than 98% except program buffer, single record buffer and export/import buffer where low hit rate is normally considered acceptable.
  • Swaps: The goal is to avoid swap in all Buffer except program buffer. Low swaps in single record buffer and export/import buffer is not significant.
  • Enough Free memory and free directory entry: this would help avoid swap. If there is free space but there is no free directory, this would cause swap. Vice Versa.

If you saw big swaps, less free directory and/or less free memory space, it would reduce swap to increase configured memory space and/or max directory entry when free main memory is available.

SWAP and buffer invalidation is different concept. Buffer invalidation is due to changes on buffered object which would involve transfer from database table. SWAP is due to shortage of free buffer space/directory. Buffer invalidation is not reflected in swap column but it would increase “database access”. SWAP itself would not increase “database access”. But next read on a swap buffered object would trigger system’s action to reload the swapped object from database, this would increase “database access”.

If database access is high for table space buffer area and swap is low, you might need to review table buffering for the instance, this could be due to a frequent changed buffered table whose buffering should be turned off. You can use SAP transaction ST10 to review table buffering or you can navigate to table buffering from the main screen.

3.2 SAP Memory analysis

3.2.1 SAP memory analysis at instance level

SAP extended memory, Heap memory, Roll memory and Page memory are SAP memory space shared by all SAP work processes. SAP memory analysis is to focus on following items

  • Free memory: We should have enough free memory in Extended and Heap memory. Current used memory should not exceed 80% to ensure that free memory is still available for new memory demand.
  • Maximum memory: Maximum used memory since start of instance should be lower than 80% of what configured memory for Extended memory and Heap memory. Otherwise, there might be memory contention causing job/program cancellation. For SAP page memory and Roll memory, the maximum used memory should not exceed sum of amount configured “in Memory” column and on disk.

It is important to online transaction performance to have enough extended memory. If this is no free extended memory, SAP work process would get memory from heap area based on SAP allocation sequence for dialog tasks. Once a Dialog is using heap memory, the SAP dialog process would be in a Private mode – cannot be shared with other tasks. If many dialog processes are put into “private mode”, this would impact dialog response time and RFC task due to shortage of dialog work processes.

If current usage is high for extended memory/heap memory space, you can go to mode list screen (Figure 3 screen) to find which program and users are consuming those memory. Base on those information, you can decide whether we need to tune memory usage for the programs and jobs, reschedule the jobs/programs or we need to have more extended memory.

3.2.2 SAP memory analysis at individual job/user level

Figure 2 screen also shows type and amount of memory which can be used by a single SAP work process and which one should be used first (Allocation sequence). The actual memory allocation for a SAP work process would depend on memory demand of the program and availability of memory of each type. A SAP work process would be terminated by SAP system if there is no memory at last step of allocation. Based on figure 2, Dialog task can have up to 7M memory in the extended memory space, if an online SAP process needs less than 7M bytes memory and there is at least 7M bytes free memory from Extended Memory, it would not use “Roll” and “heap” memory. If the online process needs more memory than what is available in heap memory after it consumes available memory from extended and roll memory space, the program/process would be terminated by system due to memory resource contention issue. In similar way, a SAP background job/process would be terminated by SAP system if the job needs more memory than what is available at extended memory space due to the fact that the job needs more than what allowed by the quota or running out of extended memory.

4. Further clarification

SAP ST02 cannot monitor SAP Extended Global Memory configured via EM/global_area_MB parameter directly. However SAP EG memory is part of SAP extended memory.

SAP ST02 memory monitor is one of SAP resource monitoring tools together with SAP operating system monitor (ST06) , SAP database monitor (DB02 or ST04) and SAP work process monitor (SM50/SM66). In my view, if there are free CPU power, free memory and enough free sap work processes, then a well-tuned SAP system should be healthy from SAP system performance point view. Based on SAP buffer and memory monitoring, the outcome of review can be one or several actions: increase SAP memory allocation at instance level, adjust memory quotas for individual process, tune application job/program and/or rescheduling job/program. How many memory can be configured is limited by physical memory and configured swap space for the server. Physical memory usage and swap space usage can be monitored via SAP transaction ST06, you can refer to my post how to run SAP transaction ST06 , navigate through ST06 Screens and understand ST06 screens


6 thoughts on “How to run SAP transaction ST02 and do performance analysis in SAP memory/buffer area”

  1. 3.2.2
    I wonder
    “Dialog task can have up to 7M memory in the extended memory space”,It’s 700M(781,250kb)?
    Please help me.thanks

    1. Hello, Yes, it can and it dependd on your server capacity and SAP memory parameters Technically, extended memory a dialog task can have is determined by SAP memory parameter ztta/roll_extension. extended memory for a dialog task should not be more than total extended memory for all dialog tasks which is specified by em/initial_size_MB which is further limited by server capacity and configuration. Most of dialog tasks should not need that much extended memory normally. if this is the case, application program design or the way a program is executed needed to be reviewed.

  2. I just want to tell you that I am all new to weblog and really loved you’re web page. Most likely Im planning to bookmark your site . You surely come with really good posts. Thank you for sharing with us your website page.

Leave a Reply

Your email address will not be published. Required fields are marked *