Beruflich Dokumente
Kultur Dokumente
Memory Inspector
Motivation
Basics
Starting the Memory Inspector
Analyzing a Memory Snapshot
Comparing Two Memory Snapshots
Summary
Memory Inspector
Motivation
Basics
Starting the Memory Inspector
Analyzing a Memory Snapshot
Comparing Two Memory Snapshots
Summary
Memory leaks will not take effect Memory leaks will take effect by
as all memory is freed during summing up as the internal mode
deletion of an internal mode. will not be deleted.
T1 T2 T3 T1 T4 cic0
A1 A2 A3 A4
Consequences
Memory Inspector
Motivation
Basics
Starting the Memory Inspector
Analyzing a Memory Snapshot
Comparing Two Memory Snapshots
Summary
Anonymous objects
Instances of classes
Created by the statement: CREATE OBJECT
OO manner-of-speaking: object
Instances of data types
Created by the statement: CREATE DATA
SAP manner-of-speaking: anonymous data object
Accessible only via references
Reference semantics
Internal tables
Named objects
Value semantics with “Copy on write”, i.e. table sharing with reference
counting
The table body is in fact the dynamic memory object
Debugger: Access also via {T:n}, where n is the id of the
internal table header
Strings
Named objects
Value semantics with “Copy on write”, i.e. string sharing with reference
counting
Debugger: Access also via {S:n}, where n is the string id
Example: Strings
Hallo
Example: Strings
Hallo
Example: Strings
Hugo Hallo
Example: Strings
Hugo Hallo
Objects
Anonymous objects
Reference semantics
No reference counting
Debugger: Access via {O:n}, where n is the object id
Memory Inspector
Motivation
Basics
Starting the Memory Inspector
Analyzing a Memory Snapshot
Comparing Two Memory Snapshots
Summary
Demo
Memory Inspector
Motivation
Basics
Starting the Memory Inspector
Analyzing a Memory Snapshot
Comparing Two Memory Snapshots
Summary
Analyzingmemory
Dynamic Memory:
objects’ sizes
Bound Memory
Bound Memory
Memoryof
Memory ofthe
theobject
object“itself”
“itself”
Minimumof
Minimum ofmemory
memorythat
thatwill
willbe
befreed,
freed,ififobject
objectisisdeleted
deleted
Referenced Memory
Memory of the object “itself” and all referenced objects
Maximum of memory that can be freed, if object is deleted
itab
oref obj1 obj2
oref
obj3
Consequently 4 values:
Bound used
Bound allocated
Referenced used
Referenced allocated
Examples:
s : {Anonymous objects} Bytes size of an object or an anonymous data object
su : {Named objects} Bytes used size of a table body (internal table) or a
string
sa : {Named objects} Bytes allocated size of a table body (internal table) or
a string
obj5
Rule: The size of a string or a table body is added to its father’s size if and
only if the reference count is one.
TopN-Consumer-Lists
Finding “objects” with high
Filter memory objects
memory consumption:
Sort according to Internal tables
Bound memory Strings
Objects
Referenced memory
Anonymous data objects
…
TopN-Consumer-List
Show all SSC objects Finding all references to the
Show all references into the SSC SSC keeping it alive.
…
Allocated / used
Memory areas (experts only )
Heap
Roll
…
Demo
TopN-Consumer-List
Memory Inspector
Motivation
Basics
Starting the Memory Inspector
Analyzing a Memory Snapshot
Comparing Two Memory Snapshots
Summary
TopN-Consumer-List
Difference of 2
snapshots
One instance of
class “lcl” was added
The added
instance comes
with 100 bytes
There are two
references to the new
instance of “lcl”
Memory Inspector
Motivation
Basics
Starting the Memory Inspector
Analyzing a Memory Snapshot
Comparing Two Memory Snapshots
Summary
In ABAP Debugger
TopN-Consumer-Lists
Aggregation of types (class/data)
Find references
List of Strongly Connected Components
Show all references into the SSC
Memory consumption overview
In Stand-Alone TA
Analyzing memory snapshots
Comparing memory snapshots
Growth of memory objects in different views
Demo
Classic Debugger
Technology
Debugger and debuggee run in the same (internal) session
Debugger dynpros placed “in-between”
Consequences
Not all ABAP code can be debugged (no conversion / field exits)
Not free of side effects (F1, F4 help, list output)
Implementation of new features not always straight-forward
No chance to use modern UI techniques (no ABAP allowed in the debugger !)
ABAP VM
Debugger Engine
/h
UI
/h
The New Debugger is started in a separated external session, after prompting “/h”
The debuggee is inactive while the debugger is active.
Advantage: During debugging you still see your last screen input
When the program is finished, the debugger is still available but inactive
The debugger is not closed as long as the debuggee (external) session is alive !
You may detach the debugger by prompting “/hx” in the debuggee session
Advantage: The debugger with all your settings, variables, breakpoints,…
is always available, when you continue debugging !
Some techniques and features are still missing in the New Debugger
-> Easy switch between the two debugger variants is provided
Demo
Process Info
Control Area
Source line / SY-Fields
Desktops
Tools
Demo
With the normal “Back” button (F3) you can “Undo” all your layout changes
Close tool
Create new tool
Exchange tool
Full screen mode
Maximize horizontally
Swap tool
Services of the tool
Context menu
Demo
Tools are integrated in debugger framework and benefit from the provided
services to customize the UI. (Change size, position, close tool ,…)
Standard tools:
Source display
Stack
Breakpoints
Variables
Detail views
Structure
Internal table
Object
Simple types
Demo
Create/Delete/Activate/Deactivate breakpoints
Demo
2 Process Architecture
Enables to debug all ABAP (incl. conversion exits)
State-of-the-art UI
All debugger settings remain unchanged during lifetime of external
mode (debugger context)
New Debuger UI
Up to 4 tools on one desktop
Arrange and size all your tools as you like
3 user specific and 6+ standard desktops
Each tool with standard services (save to local file, search ) and
more individual services
Each tool with more features
Available in NW 04
New Tools
New Edit Control : syntax highlighting, block folding, etc ..
Data Explorer : navigate through data object graphs
Diff-Tool : navigate through differences of internal
tables, structures, etc …
Loaded Programs : displays all global data of loaded programs
Trace-Tool : run SQL trace, etc from inside debugger
…
Public Web:
www.sap.com
SAP Developer Network: www.sdn.sap.com
Search for ABAP Knowledge Center
SAP Customer Services Network: www.sap.com/services/
Coming in December.
http://www.sdn.sap.com/
Q&A
Thank You !
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express
permission of SAP AG. The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other
software vendors.
Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries,
pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or
registered trademarks of IBM Corporation in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered
trademarks of Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium,
Massachusetts Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and
implemented by Netscape.
MaxDB is a trademark of MySQL AB, Sweden.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver and other SAP products and services mentioned herein
as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other
countries all over the world. All other product and service names mentioned are the trademarks of their respective
companies. Data contained in this document serves informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated
companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group
shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and
services are those that are set forth in the express warranty statements accompanying such products and services, if any.
Nothing herein should be construed as constituting an additional warranty.