Run time component memory analysis
This presentation is the property of its rightful owner.
Sponsored Links
1 / 23

Run-time Component memory analysis PowerPoint PPT Presentation


  • 36 Views
  • Uploaded on
  • Presentation posted in: General

Run-time Component memory analysis. Project members: Gati Michael Johan Muskens Merijn de Jong Michel Chaudron. 26 Sept 2003. Content. Project Introduction (goals, idea and assumptions) Problem analysis

Download Presentation

Run-time Component memory analysis

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Run time component memory analysis

Run-time Component memory analysis

Project members: Gati Michael

Johan Muskens

Merijn de Jong

Michel Chaudron

26 Sept 2003


Content

Content

  • Project Introduction

    • (goals, idea and assumptions)

  • Problem analysis

  • Why use AspectC++ Approach

  • Analysis of AspectC++

  • Modeling

  • Problems with AspectC++

  • Current status of the project


Project introduction

Project Introduction

Assumptions

Goals Main Idea

  • Flexible and extendible design

  • Reusable extensions (implementation)

  • Investigate the use of aspect orientation

  • Validate the results of the tool with Chat application

Main goal is to build a software tool to measure dynamic memory use of component based system


Project context scope

Project context & scope

Project Introduction

Robocop component

Functional model

Resource estimation model

Software

Tool

Resource

Measurement

Source code model

Document model


Goals main idea

GoalsMain Idea

Project Introduction

Assumptions

AC++

Dynamic memory information

C++ Component Code

Other

Measurement Tool


Run time component memory analysis

Project Introduction

GoalsMain Idea Assumptions

Domain

Linux development environment (G++/Ac++

compiler)

C/C++ Implementation language

Component design and development

Aspect oriented programming (AspectC++)

Mysql++ ( C++API)

Assumptions &Constraints

  • Software tool should handle any generic c/c++ component

  • Software tool should be implemented in C/C++ under Linux environment


Problem analysis existing analysis work

Chat Application

Know the design and dynamic behaviour of the system

Techniques used – function library modification

Existing debugging tools

Most tools analyze memory use by functions, call stack, block sizes

Problem analysisExisting analysis work


Problem analysis chat application idea

Problem analysisChat application Idea

  • Relied on the knowledge of the component code

Automatic instrumentation?


Problem analysis techniques of automatic instrumentation

Transform

CPU

Unparsed

C++

Parser

C++’

Transform

memory

Compile

Info

Program

Run

Problem analysisTechniques of automatic instrumentation

  • Traditional way

Extendibility

Build multiple transforms (CPU, Memory )

Reuse the parser


Problem analysis techniques of automatic instrumentation1

Problem analysisTechniques of automatic instrumentation

What is Aspect Oriented Programming?

Goal of AOP -> separation of concerns

Weaver takes the required input and process it into new program

Aspect 1

Aspect2

Extendibility

C++’

C++

Weaver

A

A

Easy to add new Aspect

B

C

Reusability

B

C

Easy to reuse the code


Problem analysis problems of instrumentation techniques

Problem AnalysisProblems of Instrumentation techniques

  • Traditional way –parsing C++is difficult.

  • Aspect approach-alreadyexistsweaver for C++ -> but It is a prototype


Why use aspectc approach

What

Profiling

Aspect

Extensibility

Yes

Yes

High level of Abstraction/

Reusability

No

Yes

Linux Platform

Yes

Yes

Time of preparation

Not feasible

Feasible

Build C++ parser

Time of preparation

-

Feasible

Aspect code

Instrumentation

Difficult

Simple

mechanism

Why use AspectC++ Approach

OPTIONS


Analysis of aspectc four main questions

Analysis of AspectC++Four Main questions

  • How to identify the patterns to instrument?

  • Which code to add to which pattern?

  • How to collect the reported data?

  • How to analyze the reported data?


Analysis of aspectc how to identify the patterns to instrument

Analysis of AspectC++How to identify the patterns to instrument?

  • Join points !!

    It is a place in the component code where an aspect code can interfere(function, a class, an attribute..)

  • Examples-join points for memory analysis


Analysis of aspectc which code to add to which pattern

Analysis of AspectC++Which code to add to which pattern?

We are interested in getting the following information

  • Size(allocated memory block)

  • Address of allocation

  • Address of deallocation

  • Time spent from allocation to deallocation

  • The name of the objects and class names


Analysis of aspectc which code to add to which pattern1

Analysis of AspectC++Which code to add to which pattern?

advice code:

You can specify when the join point should be called or executed by writing an advice code.

Syntax:

advice call (“joint point”):after(){ A}

advice call (“joint point”):before(){ A}

advice call (“joint point”):around(){ A}

Join points can be combined with logical operators (||),(&&), or (!=)


Collecting data using aspectc

Collecting data using AspectC++


Example

Analysis of AspectC++

Example

  • Measure the size allocated by malloc()

Advice call ("void * malloc (...)") && args (size): around (size_t size) {

printf ("Memory size%ld: \n", size);

tjp->proceed ();

printf ("Pointer allocated: %p\n", *tjp->result ());

}

Note: tjp==JoinPoint


Model 1 mapping the measured data to different aggregation level

Model 1-Mapping the measured data to different aggregation level

Analysis: How to analyze data

Application

Total components

Components

Total classes/ component

Classes

Total objects /class

Objects

Each object


Modeling how to analyze model 2 er model database

ModelingHow to analyze Model 2- ER- model – (Database)


Run time component memory analysis

C/C++

Input code

Aspect code

Ac++ weaving

Other profiler

C’/C’++

G. program

g++ compiling

C/C++Program

Instrumentation

Data Collection

MYSQL server

DB(3-tables)

DB connector

Data Retrieval

tables

graphs

Analyzer

Architecture

What is not

instrumented?

Class names & object names

Which data is collected?

The 3 tables-> but thee are some problems of skipping rows

Which analysis is

displayed?

Memory use over time


Problems of aspect

Problems of Aspect++

  • Compiler problems

  • some files in the gcc 3.x header files cannot be parsed byac++

  • But it works for g++ 2.9x- Take the headers from another machine and adapt the working environment for ac++

  • Unable to instrument operators new & delete

  • Pre-processor

  • Use aspect to instruct where to put overloaded operators


Next plan

Next plan

  • Implementation –> 1 Nov(25 Nov for improvement)

  • Technical problems- >5-Oct-2003

    1. Get all data from program to database

    2. Perform experiments on:

    ->Chat application with aspect code under g++2.9x

    ->Pre-processor

  • Extract tables from Db and make different analysis- 1 November

  • Writing report->20 -Jan-2004

  • Modeling chapter ->architecture and design- 17-Oct-2003

  • Implementation chapter -> 27 –Nov-2003

  • Verification & validation->12-Dec-2003

  • Management -> 20 Jan 2004


  • Login