際際滷

際際滷Share a Scribd company logo
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).

                        De鍖ne 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

More Related Content

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). De鍖ne 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