1 / 23

Analyzing Run-time Component Memory Consumption with Aspect-Oriented Techniques

Analyzing Run-time Component Memory Consumption with Aspect-Oriented Techniques. Gati Michael. Project Members: Michel Chaudron, Merijn de Jonge, Johan Muskens. Content. Project Context and Scope Project Goals Problem Analysis Aspect-Oriented Programming Why AspectC++

paco
Download Presentation

Analyzing Run-time Component Memory Consumption with Aspect-Oriented Techniques

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Analyzing Run-time Component Memory Consumption with Aspect-Oriented Techniques Gati Michael Project Members: Michel Chaudron, Merijn de Jonge, Johan Muskens

  2. Content • Project Context and Scope • Project Goals • Problem Analysis • Aspect-Oriented Programming • Why AspectC++ • Instrumentation using AspectC++ • Problems with AspectC++ • Results • Lessons Learned

  3. Project Context and Scope It is part of the ROBOCOP project Enable Robust, Reliable Operations Upgrading,Extending, Trading Components Resource management (CPU, Dynamic Memory) Prediction of resource consumption Software tool

  4. Software Tool Aspect-oriented Technique Robocop component M E A S U R E M E N T Functional model Resource model Source code model Document model Validation : Project Goals To investigate Aspect-Oriented Techniques to design and implement an automated software tool to analyze dynamic memory consumption of component-based systems.

  5. Problem Analysis Program instrumentation • Manual • Automatic – Profiling tools Disadvantages of existing profiling tools • Application level analysis • Performance analysis Introducing Aspect-Oriented Programming(AOP) No need to build a parser Exist an Aspect Weaver-> just use it

  6. Aspect-Oriented Programming What is AOP ? Is intended to help OOP in the implementation of crosscutting concerns. Crosscutting concern is a design decision that can not be encapsulated in a single function, class or module. Logging,Transaction,Security and Performance Provides modular implementation of crosscutting concerns The implementation is confined to modular units called aspects. OOP-> Implementation of crosscutting concerns is difficult to maintain

  7. Why AspectC++? AspectC++ is a general-purpose aspect-oriented extension to the C++ ROBOCOP – has a C++ language characteristics

  8. Aspect 1 Aspect 2 C++’ C++ Weaver A A B C B C Illustration of Aspect Weaver • Weaving process • Compile Transformed code • Run Transformed Extendibility Reusability The Aspect weaver inserts code fragments that are derived from aspect code whenever they are needed.

  9. Instrumentation Concepts of AspectC++ Join points Pointcuts Named Pointcuts and Composition Match Expression Advise Example

  10. Concepts of AspectC++ Join points Are points in the source code where aspect code should be applied: Class, Struct,Union, and Method Example of a method that affect memory use void* malloc (size_t) void* malloc (…)

  11. Concepts of AspectC++ Pointcuts Identify a collection of join points. A collection of calls to method malloc call(“malloc(…)”); A collection of class names derived from specific class(es) derived(“myClass”); A collection to express a scope of the joint point within(“myClass”);

  12. Concepts of AspectC++ Named pointcuts and composition A set of logical operators are used to combine pointcuts call (“void* malloc (size_t)”)|| call(“void realloc(size_t,void*)”); Pointcuts can be given names- Ease complexity Reusability

  13. Concepts of AspectC++ Pointcut memory_allocation()=call (“void* malloc (size_t)”)|| call(“void realloc(size_t,void*)”); Now memory_allocation() is reusable

  14. Concepts of AspectC++ Matched Expressions Are used to filter out specific join points void* myClass::malloc(size_t) Refers to malloc found only in myClass “%” increase flexibility to filter join points void* %::malloc(size_t) Refers to malloc found in any class

  15. Concepts AspectC++ Advice Advice specifies how aspect code should be weaved into the source code. Weaving can happen: before, after or around (before & after) a join point int x=0; Advice call(“void* malloc(..)”): void after() { x++; cout<< x<<endl; } Advice Pointcut: function { Action }

  16. Example Struct myCalc { float a,b; char a; }; int main () { myCalc* ab; (myCalc*)malloc(sizeof(myCalc)); ab.doSomething(); free(ab); };//end aspect malloc_counter { int x =0; public: Advice call(”void* malloc(…)”): void after() { x++; cout <<x<<endl; } }; //end

  17. Problems Using AspectC++ AspectC++-0.7.2 • Compiler problems • Unrecognized C++ templates • Segmentation faults

  18. Results Experiments were performed on two applications Chat application Linked List application • Measurements collected: • Absolute memory consumption over time • Accumulative memory consumption over time • Accumulative memory consumption over time related to method calls • Total Memory Summary

  19. Example Output Linked list application Expected output • Allocates 3 objects each 12 byte • De-allocates 3 objects each 12 bytes • Allocates 2 objects each 12 bytes • De-allocates 2 Objects each 2 bytes

  20. Conclusions • Investigated the feasibility of aspect-oriented technology in the context of the ROBOCOP project • The technology is viable expect for the current shortcomings • 90% of the initial goals have been achieved • 10% depends on the development of the technology. If the shortcomings will be removed in the near future-> all goals will be met

  21. Lessons Learned • Initiative -Don’t wait till you get a big picture • Communication - Management - Domain • Gained experiences - AOP -MySQL

More Related