SlideShare a Scribd company logo
Identifying Equivalent Objects to Reduce Memory
Consumption
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel
Universidad de Chile
September, 2013
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Introduction
A little about objects
Creating an object is easy
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Introduction
A little about objects
Creating an object is easy
Object new
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Introduction
My application creates lots of objects. Do I need them all?
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Color Example
Builder>>createNode
ˆ GraphicalElement new color: self defaultColor.
Builder>>defaultColor
"Gray color"
ˆ Color r: 0.5 g: 0.5 b: 0.5
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Identifying Equivalent Objects to Reduce Memory
Consumption
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel
Universidad de Chile
September, 2013
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Object Equivalence
What means Object Equivalence?
Two objects o1 and o2 are said equivalent if all objects pointing to
o1 may instead point to o2 without affecting the program
semantics and execution.
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Object Equivalence
What means Object Equivalence?
Two objects o1 and o2 are said equivalent if all objects pointing to
o1 may instead point to o2 without affecting the program
semantics and execution.
Button
"Exit"
Button
"Apply"
Button
"Copy"
Color
"Gray"
Color
"Gray"
Color
"Gray"
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Object Equivalence
What means Object Equivalence?
Two objects o1 and o2 are said equivalent if all objects pointing to
o1 may instead point to o2 without affecting the program
semantics and execution.
Button
"Exit"
Button
"Apply"
Button
"Copy"
Color
"Gray"
Color
"Gray"
Color
"Gray"
Button
"Exit"
Button
"Apply"
Button
"Copy"
Color
"Gray"
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Object Equivalence
Definition:
Our object equivalence definition says that o1 and o2 are
equivalent if:
o1 and o2 are instances of the same class.
o1 and o2 have identical state.
o1 and o2 do not mutate.
Neither o1 nor o2 uses his identity. (i.e. identityHash)
The creation of o1 nor o2 preforms a side effect.
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Profiling
Memory Profiler
Groups the objects in the execution using the previous
definition.
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Results in Roassal
Unnecessary Objects
Detected that 10.97% of the objects are unnecessary object.
Reduction on the total number of Objects
Allowed us to reduce the total number of objects in 5.1%.
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
Conclusions and Future Work
What we achieved?
Successfully identified redundant objects in the case.
Successfully removed some of the redundant objects.
And now?
More strategies to remove unnecessary objects.
Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling

More Related Content

PDF
2011 famoosr
PDF
2004 Esug Prototalk
PDF
2011 ecoop
PDF
Classboxes
PDF
Test beautycleanness
PDF
2005 Oopsla Classboxj
PDF
Roassal presentation
PDF
Presentation of Traits
2011 famoosr
2004 Esug Prototalk
2011 ecoop
Classboxes
Test beautycleanness
2005 Oopsla Classboxj
Roassal presentation
Presentation of Traits

Similar to Identifying Equivalent Objects to Reduce Memory Consumption (7)

PDF
It Is Possible to Do Object-Oriented Programming in Java
PDF
Hickey jvm summit2009
PPTX
Class and object 1
PDF
Duplicate File Analyzer using N-layer Hash and Hash Table
PDF
Preservation Planning: Choosing a suitable digital preservation strategy
PPT
Topic 6 Concepts for Object Databases.ppt
PPTX
Silicon valley nosql meetup april 2012
It Is Possible to Do Object-Oriented Programming in Java
Hickey jvm summit2009
Class and object 1
Duplicate File Analyzer using N-layer Hash and Hash Table
Preservation Planning: Choosing a suitable digital preservation strategy
Topic 6 Concepts for Object Databases.ppt
Silicon valley nosql meetup april 2012
Ad

More from ESUG (20)

PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
PDF
Directing Generative AI for Pharo Documentation
PDF
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
PDF
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
PDF
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
PDF
Analysing Python Machine Learning Notebooks with Moose
PDF
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
PDF
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
PDF
Package-Aware Approach for Repository-Level Code Completion in Pharo
PDF
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
PDF
An Analysis of Inline Method Refactoring
PDF
Identification of unnecessary object allocations using static escape analysis
PDF
Control flow-sensitive optimizations In the Druid Meta-Compiler
PDF
Clean Blocks (IWST 2025, Gdansk, Poland)
PDF
Encoding for Objects Matters (IWST 2025)
PDF
Challenges of Transpiling Smalltalk to JavaScript
PDF
Immersive experiences: what Pharo users do!
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
PDF
Cavrois - an Organic Window Management (ESUG 2025)
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
Micromaid: A simple Mermaid-like chart generator for Pharo
Directing Generative AI for Pharo Documentation
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
Analysing Python Machine Learning Notebooks with Moose
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
Package-Aware Approach for Repository-Level Code Completion in Pharo
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
An Analysis of Inline Method Refactoring
Identification of unnecessary object allocations using static escape analysis
Control flow-sensitive optimizations In the Druid Meta-Compiler
Clean Blocks (IWST 2025, Gdansk, Poland)
Encoding for Objects Matters (IWST 2025)
Challenges of Transpiling Smalltalk to JavaScript
Immersive experiences: what Pharo users do!
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
Cavrois - an Organic Window Management (ESUG 2025)
Ad

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Mushroom cultivation and it's methods.pdf
PDF
August Patch Tuesday
PDF
Getting Started with Data Integration: FME Form 101
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Heart disease approach using modified random forest and particle swarm optimi...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
A novel scalable deep ensemble learning framework for big data classification...
MIND Revenue Release Quarter 2 2025 Press Release
1 - Historical Antecedents, Social Consideration.pdf
cloud_computing_Infrastucture_as_cloud_p
Mushroom cultivation and it's methods.pdf
August Patch Tuesday
Getting Started with Data Integration: FME Form 101
Unlocking AI with Model Context Protocol (MCP)
SOPHOS-XG Firewall Administrator PPT.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Web App vs Mobile App What Should You Build First.pdf
NewMind AI Weekly Chronicles - August'25-Week II
OMC Textile Division Presentation 2021.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Zenith AI: Advanced Artificial Intelligence
Chapter 5: Probability Theory and Statistics
Heart disease approach using modified random forest and particle swarm optimi...

Identifying Equivalent Objects to Reduce Memory Consumption

  • 1. Identifying Equivalent Objects to Reduce Memory Consumption Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Universidad de Chile September, 2013 Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 2. Introduction A little about objects Creating an object is easy Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 3. Introduction A little about objects Creating an object is easy Object new Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 4. Introduction My application creates lots of objects. Do I need them all? Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 5. Color Example Builder>>createNode ˆ GraphicalElement new color: self defaultColor. Builder>>defaultColor "Gray color" ˆ Color r: 0.5 g: 0.5 b: 0.5 Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 6. Identifying Equivalent Objects to Reduce Memory Consumption Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Universidad de Chile September, 2013 Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 7. Object Equivalence What means Object Equivalence? Two objects o1 and o2 are said equivalent if all objects pointing to o1 may instead point to o2 without affecting the program semantics and execution. Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 8. Object Equivalence What means Object Equivalence? Two objects o1 and o2 are said equivalent if all objects pointing to o1 may instead point to o2 without affecting the program semantics and execution. Button "Exit" Button "Apply" Button "Copy" Color "Gray" Color "Gray" Color "Gray" Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 9. Object Equivalence What means Object Equivalence? Two objects o1 and o2 are said equivalent if all objects pointing to o1 may instead point to o2 without affecting the program semantics and execution. Button "Exit" Button "Apply" Button "Copy" Color "Gray" Color "Gray" Color "Gray" Button "Exit" Button "Apply" Button "Copy" Color "Gray" Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 10. Object Equivalence Definition: Our object equivalence definition says that o1 and o2 are equivalent if: o1 and o2 are instances of the same class. o1 and o2 have identical state. o1 and o2 do not mutate. Neither o1 nor o2 uses his identity. (i.e. identityHash) The creation of o1 nor o2 preforms a side effect. Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 11. Profiling Memory Profiler Groups the objects in the execution using the previous definition. Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 12. Results in Roassal Unnecessary Objects Detected that 10.97% of the objects are unnecessary object. Reduction on the total number of Objects Allowed us to reduce the total number of objects in 5.1%. Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling
  • 13. Conclusions and Future Work What we achieved? Successfully identified redundant objects in the case. Successfully removed some of the redundant objects. And now? More strategies to remove unnecessary objects. Alejandro Infante, Juan Pablo Sandoval, Alexandre Bergel Memory Profiling