Postmortem Memory Profiling using PERL

greenbeansneedlesSoftware and s/w Development

Dec 13, 2013 (3 years and 8 months ago)

185 views


Presentation subtitle:

20pt Arial Regular,

green R223 | G255 | B102


Recommended

maximum length: 2 lines


Confidentiality/date line: 13pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Disclaimer information may also be appear in this area. Place
flush left, aligned at bottom, 8
-
10pt Arial Regular, white


IBM logo must not
be moved, added
to, or altered in any
way.

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements


Presentation title:

28pt Arial Regular, white


Recommended maximum
length: 2 lines


Group name:

17pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

© 2002 IBM Corporation

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere
®

MQ Everyplace
®

15 May 2003


For client
presentations,
client’s logo may
go in this area

Postmortem Memory Profiling using PERL

Martyn Honeyford

Software Engineer

IBM UK Labs

martynh@uk.ibm.com


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Agenda


Introduction


Background


General requirements


Basic implementation


Intermediate implementation


Advanced implementation


Demonstration


Future Enhancements


Conclusion


Questions



IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Introduction


Who Am I?

Graduated from Nottingham University with a BSc in Computer Science.

Now work for IBM UK Labs at Hursley Park in Hampshire, nr Winchester.

WebSphere MQ Department


Assured Messaging between 25+ platforms (+ Java
TM
).

4 yrs in Service


Mostly C, C++


Windows
®
, some OS/2
®
, UNIX
®

(various flavours), OS/400
®

etc.

Last 3 yrs in MQ Everyplace Development


Mostly C


Win32, Pocket PC (aka WinCE), PalmOS



IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Background


During development of a PocketPC product in C (around 200k lines
of code), we needed to analyse memory (heap) usage.


For small devices


memory issues are particularly important


In particular we had a need to;

Track down and eliminate memory leaks

Determine maximum memory usage

Obtain a general profile of memory use


Unable to use commercial tool such as Purify as not available for
PocketPC/PalmOS.


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Background


cont.


Already had trace infrastructure;

Ability to trace function entry and exit including parameters

-
{ [Time] (Tid) Func1( Type:Value , Type:Value ,
Type:Value )

--
{ [Time] (Tid) Func2( Type:Value , Type:Value )

---
{ [Time] (Tid) MEMORY_ALLOCFN( Type:Value ,
Type:Value )

---
} [Time] (Tid) MEMORY_ALLOCFN( Type:Value ,
Type:Value ) (rc= RETURN_CODE), (erc= REASON_CODE)

--
} [Time] (Tid) Func2( Type:Value , Type:Value ) (rc=
RETURN_CODE), (erc= REASON_CODE)

-
} [Time] (Tid) Func1( Type:Value , Type:Value ,
Type:Value ) (rc= RETURN_CODE), (erc= REASON_CODE)


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Background


cont


Not easy to obtain a high level view



Was taking a long time to wade through trace and track down leaks



Decided to develop a tool which would analyse trace files and output
various pieces of information we may be interested in.



For speed/ease of development, decided to use PERL.



Note: Very simple technique.


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

General Requirements for this technique to work


Ability to capture;

Record of all memory allocations, including pointer value + size

Record of all memory free calls, including pointer value

Eg;

Alloc, 0x12345678, 0x10

Alloc, 0x23456789, 0x24

...

Free, 0x12345678


Can be achieved by funnelling all memory calls through a few
functions.


Output via existing trace, or add simple trace around memory
allocations.


If this is not possible, can intercept OS memory calls eg;


forwarding DLL on Windows


LD_PRELOAD on Linux


Trap patching on PalmOS etc.


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Basic Implementation


Leak detection


Algorithm

Run application and capture memory trace

PERL script reads trace.


For each line;



If alloc, add to list, indexed by pointer value (+ store size)



If free, search list for pointer value and remove entry


At the end, add up all the items left in the list


all this memory has
been leaked.


Notes:

Must be “complete” run of application

If memory frees are not correctly traced, may have “phantom leaks”



IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Basic Implementation


Maximum memory usage


Algorithm

Run application and capture memory trace

PERL script reads trace.


For each line;



If alloc, add to list, increment max counter by size



If free, search list, remove entry + decrement count by stored size


At the end, print out value of max counter.


Notes:

Doesn’t have to be “complete” run of application

Still need to keep list as free call typically doesn’t specify size.



IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Basic Implementation

Memory profile


Algorithm

Run application and capture memory trace

PERL script reads trace.


For each line;



If alloc, add to list, increment max counter, print current count



If free, search list, remove entry, decrement count, print current count


Notes:

Doesn’t have to be “complete” run of application

Still need to keep list as free call typically doesn’t specify size.



IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Basic Implementation
-

Conclusion


Provides useful information concerning memory leaks + usage



Not all that helpful for fixing problems however because;



Doesn’t tell us where leaks are coming from!


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Intermediate Implementation


Additional requirements

In addition to the previous, also record some indication of immediate
location where allocate was called from, eg filename and line number.

Eg;

Alloc, 0x12345678, 0x10, testApp.c:23

Alloc, 0x23456789, 0x24, testApp.c:26

...

Free, 0x12345678

Could be achieved in C by replacing allocate calls with a Macro which
inserts filename and line number

Alternatively add a parameter (string/number) to allocate function and then
pre
-
process source with an external tool (eg perl script) which puts a
unique value in each call to function.


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Intermediate Implementation


Algorithms


Exactly as before, but in list also store additional information and
print out at the end.


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Intermediate Implementation
-

Conclusion


Much better than basic implementation


we now know where
allocations are coming from.


Still a major limitation however;


Only provides local location information


may not help much


Eg we have a pseudo
-
object
-
oriented model

We have a string class which allocates memory on creation and frees
memory on destruction

Using this technique, if we create a string and don’t destroy it, it would
show up as a leak in the string class when actual “leak” is that the
string is not being destroyed.


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Advanced Implementation


Additional requirements

In addition to the previous, also record complete call stack at time of
allocation.

Eg;

Alloc, 0x12345678, 0x10, testApp.c:23 main func1 func2

Alloc, 0x23456789, 0x24, testApp.c:26 main func3

...

Free, 0x12345678

Could be achieved by;


altering source to keep record of call stack


infer from rest of trace (technique we use)


operating system specific techniques (such as using debug
information, walking the stack etc.)


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Advanced Implementation
-

Algorithms


Again, exactly as before, just storing and printing additional stack
information


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Advanced Implementation
-

conclusion


Again, this is an improvement over the intermediate solution.


We now can put the allocation completely into context

Eg if the allocation is within string_new just look one level up.


Can use to pinpoint memory leaks


Also useful to know what the stack was when the maximum memory
was in use


Can produce much more accurate profile

Eg by API, by component etc.


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Demonstration


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Future Enhancements


Allow more detailed break down of memory use


eg per top
-
level API, per component etc.


Provide more options for visual representation of memory use;

Line graph of memory during execution


Multiple Lines


per thread, per component etc.


Automatically add labels at interesting points (eg top
-
level API calls)

Pie Charts


Per component

Bar Charts


Per component


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Future Enhancements
-

cont


Allow real
-
time monitoring/graphing


Use timing information to chart short
-
lived allocations

Move to static buffer/stack ?


Analysis of Fragmentation

Difficult to measure

Could graphically display location of memory allocated

Already used to coalesce small allocations



IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Conclusion


Simple technique


easy to implement and understand


Pros of this technique

Free (compared with commercial tools)

Can be tailored to exactly the information you require

Don’t need a special build


particularly useful for customer installations.

Cross
-
platform (Win32, PocketPC, PalmOS ….)


Cons of this technique

Have to do some work up front to obtain memory information

To get full benefit, need hierarchical trace (but this is useful anyway)

Doesn’t measure memory not allocated directly (eg via system APIs)


this can be worked around by intercepting OS memory calls.



IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Questions


Any questions?


IBM logo must not
be moved, added
to, or altered in

any way.





Background should

not be modified,
except for quotes,
which use gray
background.


Title/subtitle/confidentiality line: 10pt Arial Regular, white

Maximum length: 1 line


Information separated by vertical strokes,

with two spaces on either side


Slide heading:

28pt Arial Regular, light
blue R204 | G204 | B255


Maximum length: 2 lines








Slide body:

18pt Arial Regular, white


Square bullet color:

green R223 | G255 | B102


Recommended maximum
text length: 5 principal
points


Group name:

14pt Arial Regular, white


Maximum length: 1 line


Copyright: 10pt Arial

Regular, white

Template release: Oct 02

For the latest, go to http://w3.ibm.com/ibm/presentations

WebSphere MQ Everyplace

Postmortem Memory Profiling using PERL

© 2003 IBM Corporation

Optional slide number:

10pt Arial Bold, white

Indications in green = Live content


Indications in white = Edit in master

Indications in blue = Locked elements

Indications in black = Optional elements

Trademarks


WebSphere, Everyplace, OS/2 and OS/400 are trademarks of
International Business Machines Corporation in the United States,
other countries or both.


Java and all Java
-
based trademarks and logos are trademarks of
Sun Microsystems, Inc. in the United States, other countries, or both


Windows is a registered trademark of Microsoft Corporation in the
United States, other countries, or both.


UNIX is a registered trademark of The Open Group in the United
States and other countries.


Other company, product or service names may be trademarks or
service marks of others.