SlideShare a Scribd company logo
Object graphs
                           swapping
                    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

Wednesday, September 15, 2010
The context




                                     2
Wednesday, September 15, 2010
The context




                                     2
Wednesday, September 15, 2010
The context




                                     2
Wednesday, September 15, 2010
The context




                                     2
Wednesday, September 15, 2010
The context




                                     2
Wednesday, September 15, 2010
The context




                                     2
Wednesday, September 15, 2010
Problem

                       Use more memory than needed.

                       Make OOP languages unsuitable for memory
                       limited devices.

                       Existence of unused but referenced objects.



                                           3
Wednesday, September 15, 2010
The context
     In OOP primary memory is represented by an object graph

                                                Z
                                    X
                                                        Y



                                    A       B       C



                                D       E   F   G               H



                                        I   J   K           L
                                            4
Wednesday, September 15, 2010
Garbage Collector
                    Only collects objects that nobody else points to.

                                                     Z
                                    X
                                                             Y



                                    A       B            C



                                D       E   F       G                H



                                        I   J       K            L
                                            5
Wednesday, September 15, 2010
Garbage Collector
                    Only collects objects that nobody else points to.

                                                     Z
                                    X
                                                             Y



                                    A       B            C



                                D       E   F       G                H



                                        I   J       K            L
                                            5
Wednesday, September 15, 2010
Garbage Collector
                    Only collects objects that nobody else points to.

                                                     Z
                                    X
                                                             Y



                                    A       B            C



                                D       E   F       G                H



                                        I   J       K            L
                                            5
Wednesday, September 15, 2010
Garbage Collector
                    Only collects objects that nobody else points to.

                                                     Z
                                    X
                                                             Y



                                    A       B            C



                                D       E   F       G                H



                                        I   J       K            L
                                            5
Wednesday, September 15, 2010
But...what happens with referenced yet unused objects?


                                                Z
                                    X
                                                        Y



                                    A       B       C



                                D       E   F   G               H



                                        I   J   K           L

                                            6
Wednesday, September 15, 2010
Idea


                       Swap out (not remove) unused objects to
                       disk.

                       Automatically load them back when needed.




                                           7
Wednesday, September 15, 2010
Related work


                       Large object oriented memory (LOOM).

                       Melt - Supporting memory leaks.

                       ImageSegments.




                                          8
Wednesday, September 15, 2010
But...no one solves all the problems




                                         9
Wednesday, September 15, 2010
Main challenges

                       Not to use more memory than the one
                       released by swapping.

                       Low overhead penalty.

                       Group objects in an smart way.



                                           10
Wednesday, September 15, 2010
Key aspects

                       Mark and trace unused/used objects at
                       runtime.

                       The usage of proxies.

                       Group unused objects (subgraphs).



                                           11
Wednesday, September 15, 2010
Why we need to
                                group objects?

                       Because if we replace each object by a proxy,
                       we release little memory.

                       We want to replace a whole group by one or a
                       few proxies.




                                           12
Wednesday, September 15, 2010
Why subgraphs?


                       Group of objects that are used (or not used)
                       together.

                       We need few proxies (for the roots) for
                       several objects.




                                           13
Wednesday, September 15, 2010
Experiments done

                       Modify Smalltalk VM to mark and trace
                       objects usage.

                       Visualize objects and memory usage.

                       Take statistics from different scenarios.



                                             14
Wednesday, September 15, 2010
deployed web
                    application example
                         Used          Unused        Used        Unused
                        Amount of objects            Amount of memory



                                  4%
                                                               15%




                                                       85%
                                96%



                                                15
Wednesday, September 15, 2010
Swapping steps and
                        challenges

                   1.Identify sets of objects and serialize them.
                     Problems: cycles, speed, etc.

                   2.Write the serialized objects into a file.
                     Problems: file format, encoding, speed, etc.

                   3. Load the objects from a file. Problems: class
                     reshape, avoid duplicates, speed, etc.

                                          16
Wednesday, September 15, 2010
Subgraphs
                                Roots            Inner            Shared            External




                                     X                                 Z
                                                                                Y
                                                 Subgraph to process

                                     A                    B                 C
                                    (Root)               (Root)            (Root)




                                D            E            F            G            H



                                             I            J            K            L

                                                          17
Wednesday, September 15, 2010
More
                                                 problems
                                                                              Should shared objects be
         Roots                  Inner            Shared            External
                                                                              included or not?

                                                                              GC moves objects.
              X                                       Z
                                                               Y
                                Subgraph to process                           Pointers update.
               A                         B                 C
             (Root)                     (Root)            (Root)
                                                                              Class changes.

         D             E                 F            G            H          Recreate and reinitialize
                                                                              objects.
                        I                J            K            L
                                                                              Code executed after
                                                                       18     loading.
Wednesday, September 15, 2010
ImageSegment



Wednesday, September 15, 2010
ImageSegment basis
                       Only write/swap roots and inner objects.

                       Shared objects are NOT swapped.

                       Keep an array in memory for the shared
                       objects.

                       Update object pointers to point to a relative
                       address inside the arrays (offset).

                       Roots are replaced by proxies.

                       Uses GC facilities to detect shared objects.
Wednesday, September 15, 2010
Subgraph traverse
    Serialized objects WordArray
                                            Shared objects Array



                                A       B        C


                            D       E   F    G        H


                                    I   J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’

    Serialized objects WordArray
                                             Shared objects Array



                                 A       B        C


                             D       E   F    G        H


                                     I   J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’

    Serialized objects WordArray
                                             Shared objects Array



                                 A       B        C


                             D       E   F    G        H


                                     I   J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’

    Serialized objects WordArray
                                             Shared objects Array



                                 A       B        C


                             D       E   F    G        H


                                     I   J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’

    Serialized objects WordArray
                                             Shared objects Array



                                 A       B        C


                             D       E   F    G        H


                                     I   J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’
                                              D
    Serialized objects WordArray
                                             Shared objects Array



                                 A       B        C


                             D       E   F    G        H


                                     I   J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’
                                              D
    Serialized objects WordArray
                                             Shared objects Array



                                 A       B        C


                             D       E   F    G        H


                                     I   J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’
                                                       D
    Serialized objects WordArray
                                         offset       Shared objects Array



                                 A                B        C


                             D       E            F    G        H


                                     I            J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’       E’
                                                            D
    Serialized objects WordArray
                                              offset       Shared objects Array



                                      A                B        C


                             D            E            F    G        H


                                          I            J    K        L


Wednesday, September 15, 2010
Subgraph traverse
                  offset

      A’       B’       C’       E’
                                                            D
    Serialized objects WordArray
                                              offset       Shared objects Array



                                      A                B        C


                             D            E            F    G        H


                                          I            J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’       E’
                                                   D
    Serialized objects WordArray
                                                  Shared objects Array



                                      A       B        C


                             D            E   F    G        H


                                          I   J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’       E’
                                                   D
    Serialized objects WordArray
                                                  Shared objects Array



                                      A       B        C


                             D            E   F    G        H


                                          I   J    K        L


Wednesday, September 15, 2010
Subgraph traverse
      A’       B’       C’       E’   I’   H’   L’
                                                          D   F   G       J
    Serialized objects WordArray
                                                         Shared objects Array



                                      A              B        C


                             D             E         F    G           H


                                           I         J    K           L


Wednesday, September 15, 2010
Offset        Memory address


      A’       B’        C’       E’   I’   H’   L’
                                                                 D   F   G       J
      Serialized objects WordArray
                                                               Shared objects Array



                                       A              B              C


                              D              E        F         G            H


                                             I        J         K            L

Wednesday, September 15, 2010
anImageSegment


       A’       B’       C’     E’   I’   H’   L’                     D   F   G   J

Serialized objects WordArray                                         Shared objects Array




                                     A                B                   C


                            D             E           F              G        H


                                          I           J              K        L

Wednesday, September 15, 2010
anImageSegment


       A’       B’       C’     E’   I’   H’   L’                     D    F   G   J

Serialized objects WordArray                                         Shared objects Array




                                     P1              P2                   P3


                            D             E           F              G         H


                                          I           J              K         L

Wednesday, September 15, 2010
anImageSegment


       A’       B’       C’     E’   I’   H’   L’                     D    F   G   J

Serialized objects WordArray                                         Shared objects Array




                                     P1              P2                   P3


                            D             E           F              G         H


                                          I           J              K         L

Wednesday, September 15, 2010
anImageSegment


       A’       B’       C’     E’   I’   H’   L’                     D    F   G   J

Serialized objects WordArray                                         Shared objects Array




                                     P1              P2                   P3


                            D                         F              G


                                                      J              K

Wednesday, September 15, 2010
anImageSegment


                                                                      D   F   G   J
       A’       B’       C’     E’   I’   H’   L’

Serialized objects WordArray                                         Shared objects Array



                Binary file
                                                         P1          P2
                                                                     B                P3
                                                                                      C


                                                            D         F           G


                                                                     J            K


Wednesday, September 15, 2010
anImageSegment


                                                                      D   F   G   J

                                                                     Shared objects Array



                Binary file
    A’       B’       C’        E’   I’   H’   L’        P1          P2
                                                                     B                P3
                                                                                      C


                                                            D         F           G


                                                                     J            K


Wednesday, September 15, 2010
anImageSegment


                            NIL                                       D   F   G   J

                                                                     Shared objects Array



                Binary file
    A’       B’       C’        E’   I’   H’   L’        P1          P2
                                                                     B                P3
                                                                                      C


                                                            D         F           G


                                                                     J            K


Wednesday, September 15, 2010
ImageSegment
                                 conclusions
                        Good speed.

                        Graph traverse is done in VM side.

                        Good use of GC facilities.

                        You have to be aware of shared objects.

                        Bad granularity level.

                        Implicit needed information in object graphs.

Wednesday, September 15, 2010
Thanks!

                                Mariano Martinez Peck
                                marianopeck@gmail.com




Wednesday, September 15, 2010

More Related Content

More from ESUG

Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
ESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
ESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
ESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
ESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 
BioSmalltalk
BioSmalltalkBioSmalltalk
BioSmalltalk
ESUG
 

More from ESUG (20)

Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 
BioSmalltalk
BioSmalltalkBioSmalltalk
BioSmalltalk
 

Recently uploaded

JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
Fwdays
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
DianaGray10
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
UiPathCommunity
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
zjhamm304
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
LizaNolte
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 

Recently uploaded (20)

JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
 
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...QA or the Highway - Component Testing: Bridging the gap between frontend appl...
QA or the Highway - Component Testing: Bridging the gap between frontend appl...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 

Object Graph Swapping

  • 1. Object graphs swapping 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 Wednesday, September 15, 2010
  • 2. The context 2 Wednesday, September 15, 2010
  • 3. The context 2 Wednesday, September 15, 2010
  • 4. The context 2 Wednesday, September 15, 2010
  • 5. The context 2 Wednesday, September 15, 2010
  • 6. The context 2 Wednesday, September 15, 2010
  • 7. The context 2 Wednesday, September 15, 2010
  • 8. Problem Use more memory than needed. Make OOP languages unsuitable for memory limited devices. Existence of unused but referenced objects. 3 Wednesday, September 15, 2010
  • 9. The context In OOP primary memory is represented by an object graph Z X Y A B C D E F G H I J K L 4 Wednesday, September 15, 2010
  • 10. Garbage Collector Only collects objects that nobody else points to. Z X Y A B C D E F G H I J K L 5 Wednesday, September 15, 2010
  • 11. Garbage Collector Only collects objects that nobody else points to. Z X Y A B C D E F G H I J K L 5 Wednesday, September 15, 2010
  • 12. Garbage Collector Only collects objects that nobody else points to. Z X Y A B C D E F G H I J K L 5 Wednesday, September 15, 2010
  • 13. Garbage Collector Only collects objects that nobody else points to. Z X Y A B C D E F G H I J K L 5 Wednesday, September 15, 2010
  • 14. But...what happens with referenced yet unused objects? Z X Y A B C D E F G H I J K L 6 Wednesday, September 15, 2010
  • 15. Idea Swap out (not remove) unused objects to disk. Automatically load them back when needed. 7 Wednesday, September 15, 2010
  • 16. Related work Large object oriented memory (LOOM). Melt - Supporting memory leaks. ImageSegments. 8 Wednesday, September 15, 2010
  • 17. But...no one solves all the problems 9 Wednesday, September 15, 2010
  • 18. Main challenges Not to use more memory than the one released by swapping. Low overhead penalty. Group objects in an smart way. 10 Wednesday, September 15, 2010
  • 19. Key aspects Mark and trace unused/used objects at runtime. The usage of proxies. Group unused objects (subgraphs). 11 Wednesday, September 15, 2010
  • 20. Why we need to group objects? Because if we replace each object by a proxy, we release little memory. We want to replace a whole group by one or a few proxies. 12 Wednesday, September 15, 2010
  • 21. Why subgraphs? Group of objects that are used (or not used) together. We need few proxies (for the roots) for several objects. 13 Wednesday, September 15, 2010
  • 22. Experiments done Modify Smalltalk VM to mark and trace objects usage. Visualize objects and memory usage. Take statistics from different scenarios. 14 Wednesday, September 15, 2010
  • 23. deployed web application example Used Unused Used Unused Amount of objects Amount of memory 4% 15% 85% 96% 15 Wednesday, September 15, 2010
  • 24. Swapping steps and challenges 1.Identify sets of objects and serialize them. Problems: cycles, speed, etc. 2.Write the serialized objects into a file. Problems: file format, encoding, speed, etc. 3. Load the objects from a file. Problems: class reshape, avoid duplicates, speed, etc. 16 Wednesday, September 15, 2010
  • 25. Subgraphs Roots Inner Shared External X Z Y Subgraph to process A B C (Root) (Root) (Root) D E F G H I J K L 17 Wednesday, September 15, 2010
  • 26. More problems Should shared objects be Roots Inner Shared External included or not? GC moves objects. X Z Y Subgraph to process Pointers update. A B C (Root) (Root) (Root) Class changes. D E F G H Recreate and reinitialize objects. I J K L Code executed after 18 loading. Wednesday, September 15, 2010
  • 28. ImageSegment basis Only write/swap roots and inner objects. Shared objects are NOT swapped. Keep an array in memory for the shared objects. Update object pointers to point to a relative address inside the arrays (offset). Roots are replaced by proxies. Uses GC facilities to detect shared objects. Wednesday, September 15, 2010
  • 29. Subgraph traverse Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 30. Subgraph traverse A’ B’ C’ Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 31. Subgraph traverse A’ B’ C’ Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 32. Subgraph traverse A’ B’ C’ Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 33. Subgraph traverse A’ B’ C’ Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 34. Subgraph traverse A’ B’ C’ D Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 35. Subgraph traverse A’ B’ C’ D Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 36. Subgraph traverse A’ B’ C’ D Serialized objects WordArray offset Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 37. Subgraph traverse A’ B’ C’ E’ D Serialized objects WordArray offset Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 38. Subgraph traverse offset A’ B’ C’ E’ D Serialized objects WordArray offset Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 39. Subgraph traverse A’ B’ C’ E’ D Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 40. Subgraph traverse A’ B’ C’ E’ D Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 41. Subgraph traverse A’ B’ C’ E’ I’ H’ L’ D F G J Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 42. Offset Memory address A’ B’ C’ E’ I’ H’ L’ D F G J Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 43. anImageSegment A’ B’ C’ E’ I’ H’ L’ D F G J Serialized objects WordArray Shared objects Array A B C D E F G H I J K L Wednesday, September 15, 2010
  • 44. anImageSegment A’ B’ C’ E’ I’ H’ L’ D F G J Serialized objects WordArray Shared objects Array P1 P2 P3 D E F G H I J K L Wednesday, September 15, 2010
  • 45. anImageSegment A’ B’ C’ E’ I’ H’ L’ D F G J Serialized objects WordArray Shared objects Array P1 P2 P3 D E F G H I J K L Wednesday, September 15, 2010
  • 46. anImageSegment A’ B’ C’ E’ I’ H’ L’ D F G J Serialized objects WordArray Shared objects Array P1 P2 P3 D F G J K Wednesday, September 15, 2010
  • 47. anImageSegment D F G J A’ B’ C’ E’ I’ H’ L’ Serialized objects WordArray Shared objects Array Binary file P1 P2 B P3 C D F G J K Wednesday, September 15, 2010
  • 48. anImageSegment D F G J Shared objects Array Binary file A’ B’ C’ E’ I’ H’ L’ P1 P2 B P3 C D F G J K Wednesday, September 15, 2010
  • 49. anImageSegment NIL D F G J Shared objects Array Binary file A’ B’ C’ E’ I’ H’ L’ P1 P2 B P3 C D F G J K Wednesday, September 15, 2010
  • 50. ImageSegment conclusions Good speed. Graph traverse is done in VM side. Good use of GC facilities. You have to be aware of shared objects. Bad granularity level. Implicit needed information in object graphs. Wednesday, September 15, 2010
  • 51. Thanks! Mariano Martinez Peck marianopeck@gmail.com Wednesday, September 15, 2010