SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Visualizing
                               Objects and
                              Memory Usage
        I n g .               m a r i a n o          m a rt i n e z          p e c k
                                 m a r i a n o p e c k @ g m a i l . c o m




                                                     1

Saturday, November 13, 2010
The context




                                   2
Saturday, November 13, 2010
The context




                                   2
Saturday, November 13, 2010
The context




                                   2
Saturday, November 13, 2010
The context




                                   2
Saturday, November 13, 2010
The context




                                   2
Saturday, November 13, 2010
1st step: UNDERSTAND.

                     To understand: VISUALIZATIONS.

                                      3
Saturday, November 13, 2010
Problem

                        How to visualize objects and memory usage.

                        Special treatment for classes, methods and
                        packages.

                        Take into account objects usage.



                                             4
Saturday, November 13, 2010
Regarding related work...
                                 no one solves the problem of
                              taking into account objects usage.




                                              5
Saturday, November 13, 2010
Our solution


                        Trace objects usage.

                        Use DistributionMaps to visualize the results.




                                               6
Saturday, November 13, 2010
Moose is a platform for
                              software and data analysis




                                          7
Saturday, November 13, 2010
DistributionMap
                       “Distribution Map visualizes parts of a system
                       and shows how properties of the part elements
                       spread over the initial parts. ”
                                     part 1     part 2       part 3

                  Property1
                  Property2
                  Property3            part 5            part 4
                                                                             Element
                  Property4



                                                                      Container
                                                8
Saturday, November 13, 2010
JBOSS example




                                    9
Saturday, November 13, 2010
Used Object Maps


                                Distribution Maps that take into
                               account objects and memory usage




                                               10
Saturday, November 13, 2010
How to use them?

                    1.Start the analysis.

                    2.Run the scenario to analyze.

                    3.Stop the analysis.

                    4.Visualize using DistributionMaps.



                                            11
Saturday, November 13, 2010
SHOWTIME




                                 12
Saturday, November 13, 2010
Tracing Objects
                                   Usage

                        Usage bit in the Object Header (Virtual
                        Machine).

                        Define “when an objects is marked as used?”.

                        Modify VM to mark objects when used.



                                            13
Saturday, November 13, 2010
when an objects is
                         marked as used?

                        Quick answer: when it receives a message.

                        When the VM directly use it.

                        When used by special VM bytecodes (#class,
                        #==, etc).



                                            14
Saturday, November 13, 2010
Showtime 2




                                  15
Saturday, November 13, 2010
Possible uses

                        When building minimal images.

                        Virtual memory implementations.

                        Detect bad smells or possible overuse of
                        memory.

                        Detect opportunities of refactorings.


                                             16
Saturday, November 13, 2010
conclusions and
                                future work

                      Use Distribution Maps and distinguish
                    between used and unused instances.

                     Useful to analyze the system and to know
                    which objects are used in different scenarios.

                        DistributionMap comparator.



Saturday, November 13, 2010
Thanks!

                              Mariano Martinez Peck
                              marianopeck@gmail.com




Saturday, November 13, 2010

Weitere ähnliche Inhalte

Mehr von Mariano Martínez Peck

Mehr von Mariano Martínez Peck (11)

Smalltalk and Business
Smalltalk and BusinessSmalltalk and Business
Smalltalk and Business
 
Web Development with Smalltalk
Web Development with SmalltalkWeb Development with Smalltalk
Web Development with Smalltalk
 
Object garphs swapping
Object garphs swappingObject garphs swapping
Object garphs swapping
 
Metacello
MetacelloMetacello
Metacello
 
Efficient Proxies in Smalltalk
Efficient Proxies in SmalltalkEfficient Proxies in Smalltalk
Efficient Proxies in Smalltalk
 
DBXTalk: Smalltalk Relational Database Suite
DBXTalk: Smalltalk Relational Database SuiteDBXTalk: Smalltalk Relational Database Suite
DBXTalk: Smalltalk Relational Database Suite
 
Clustered Serialization with Fuel
Clustered Serialization with FuelClustered Serialization with Fuel
Clustered Serialization with Fuel
 
PhD Thesis Defense Presentation
PhD Thesis Defense PresentationPhD Thesis Defense Presentation
PhD Thesis Defense Presentation
 
Building you own Pharo images with Metacello
Building you own Pharo images with Metacello Building you own Pharo images with Metacello
Building you own Pharo images with Metacello
 
Object swapping issues and the imagesegment implementation
Object swapping issues and the imagesegment implementationObject swapping issues and the imagesegment implementation
Object swapping issues and the imagesegment implementation
 
SqueakDBX
SqueakDBXSqueakDBX
SqueakDBX
 

Visualizing Objects and Memory Usage

  • 1. Visualizing Objects and Memory Usage I n g . m a r i a n o m a rt i n e z p e c k m a r i a n o p e c k @ g m a i l . c o m 1 Saturday, November 13, 2010
  • 2. The context 2 Saturday, November 13, 2010
  • 3. The context 2 Saturday, November 13, 2010
  • 4. The context 2 Saturday, November 13, 2010
  • 5. The context 2 Saturday, November 13, 2010
  • 6. The context 2 Saturday, November 13, 2010
  • 7. 1st step: UNDERSTAND. To understand: VISUALIZATIONS. 3 Saturday, November 13, 2010
  • 8. Problem How to visualize objects and memory usage. Special treatment for classes, methods and packages. Take into account objects usage. 4 Saturday, November 13, 2010
  • 9. Regarding related work... no one solves the problem of taking into account objects usage. 5 Saturday, November 13, 2010
  • 10. Our solution Trace objects usage. Use DistributionMaps to visualize the results. 6 Saturday, November 13, 2010
  • 11. Moose is a platform for software and data analysis 7 Saturday, November 13, 2010
  • 12. DistributionMap “Distribution Map visualizes parts of a system and shows how properties of the part elements spread over the initial parts. ” part 1 part 2 part 3 Property1 Property2 Property3 part 5 part 4 Element Property4 Container 8 Saturday, November 13, 2010
  • 13. JBOSS example 9 Saturday, November 13, 2010
  • 14. Used Object Maps Distribution Maps that take into account objects and memory usage 10 Saturday, November 13, 2010
  • 15. How to use them? 1.Start the analysis. 2.Run the scenario to analyze. 3.Stop the analysis. 4.Visualize using DistributionMaps. 11 Saturday, November 13, 2010
  • 16. SHOWTIME 12 Saturday, November 13, 2010
  • 17. Tracing Objects Usage Usage bit in the Object Header (Virtual Machine). Define “when an objects is marked as used?”. Modify VM to mark objects when used. 13 Saturday, November 13, 2010
  • 18. when an objects is marked as used? Quick answer: when it receives a message. When the VM directly use it. When used by special VM bytecodes (#class, #==, etc). 14 Saturday, November 13, 2010
  • 19. Showtime 2 15 Saturday, November 13, 2010
  • 20. Possible uses When building minimal images. Virtual memory implementations. Detect bad smells or possible overuse of memory. Detect opportunities of refactorings. 16 Saturday, November 13, 2010
  • 21. conclusions and future work Use Distribution Maps and distinguish between used and unused instances. Useful to analyze the system and to know which objects are used in different scenarios. DistributionMap comparator. Saturday, November 13, 2010
  • 22. Thanks! Mariano Martinez Peck marianopeck@gmail.com Saturday, November 13, 2010