SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
Memory Optimizing Java ME
applications

Sreekumar Pillai , CTO, Experion
Java ME Platform

§ Java ME devices often are consumer devices which
   has resource constraints

§ Mobile devices are not small PCs

§ Applications are to make best use of the available
   resources

§ Development requires a different mindset which
   expects unexpected things !
Why memory optimization?

§ Functionality is often given priority in initial phases
   of development

§ Performance tuning takes a backseat and generally
   developers ignore efficient usage of memory

§ Memory issues are hard to fix

§ In Java ME this can be fatal and midlet may not run
   at all
Java ME Enterprise applications

§ Enterprise applications are mostly used by staff to
   perform operations while they are on Field

§ Typically such applications require to connect to a
   backend server for data access

§ Volume of data can be a bottleneck and requires
   careful design and optimization
Java ME Memory architecture

§ Automatic memory management is part of JVM

§ Heap
 -  Heap is created by JVM at startup
 -  Class instances are allocated in Heap
 -  Size of Heap is typically fixed to 2Mb (low end devices)

§ Garbage Collection
 -  JVM Specification mandates a garbage collection mechanism
 -  Programmer is not allowed to explicitly deallocate the memory of
    an object
Garbage collection

§ There is no concept of a pointer in Java

§ Memory management is left to JVM

§ GC is provided by JVM to reclaim the unreferenced
   memory

§ An object is eligible for garbage collection if it can
   not be accessed by any live thread
Detecting memory issues

§ Exceptions
 -  JVM Throws OutOfMemoryError
 -  When trying to allocate more memory than available as a
    single chunk


§ Memory Profiler
 -  See the objects being allocated and the memory they
    occupy
 -  Set the available amount of memory and stress the
    application
Memory profiler
Memory profiler
How do we optimize ?
Object allocations
§ Use as few as possible

§ Dereference objects(set to NULL) to enable GC

§ Reuse objects

§ Heap fragmentation
 -  See the possibility of doing large allocations first


§ Catch OutOfMemoryError for large allocations
Reorganize UI Navigation

§ Having more UI elements in a single screen
   increases the memory requirment
§ Good to reduce the data presented in a single
   screen
§ Long lists & scrolling does not result in good user
   experience
§ Split the data into multiple screens ( e.g. a product
   catalogue can be splitted into category, sub
   category, and item screens )
Data representations
§ XML
 -  XML is suitable for hierarchical data like a product
    catalogue
 -  XML is lengthy and occupies more bandwidth


§ JSON
 -  Simple than XML
 -  More popular among developers


§ CSV / Custom Fixed length
 -  Full control over data format and parsing
XML Vs JSON
<widget>                                            {"widget": {
  <debug>on</debug>                                    "debug": "on",
                                                       "window": {
  <window title="Sample Konfabulator Widget">
                                                          "title": "Sample Konfabulator Widget",
     <name>main_window</name>                             "name": "main_window",
     <width>500</width>                                   "width": 500,
     <height>500</height>                                 "height": 500
  </window>                                            },
                                                       "image": {
  <image src="Images/Sun.png" name="sun1">
                                                          "src": "Images/Sun.png",
     <hOffset>250</hOffset>                               "name": "sun1",
     <vOffset>250</vOffset>                               "hOffset": 250,
     <alignment>center</alignment>                        "vOffset": 250,
                                                          "alignment": "center"
  </image>
                                                       },
  <text data="Click Here" size="36" style="bold">
                                                       "text": {
     <name>text1</name>                                   "data": "Click Here",
     <hOffset>250</hOffset>                               "size": 36,
     <vOffset>100</vOffset>                               "style": "bold",
     <alignment>center</alignment>                        "name": "text1",
                                                          "hOffset": 250,
     <onMouseUp>
                                                          "vOffset": 100,
       sun1.opacity = (sun1.opacity / 100) * 90;          "alignment": "center",
     </onMouseUp>                                         "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
  </text>                                              }
</widget>                                           }}
Optimizing XML / JSON

§ Reduce size of tags / keys
  § <Product code>PT1432</Product code>


§ Reduce the number of fields required in client side
 -  Very generalized web services is an overhead for client
    applciations


§ Parsers are memory intensive - For large data
   strings alternate options to be considered
RMS - Alternate storage

§ RMS RecordStore can be used for storing data
   when size is high

§ RecordStore can be addressed using a name tag

§ Organize data – Read required information into
   memory
JAR Size

§ Reduce size of classes
 -  Use an obfuscator to minimize the size of classes


§ Themes
 -  Do you require multiple themes ?


§ Images
 -  Minimize resource sizes
 -  Use fewer colors as possible
Thank you ...

Más contenido relacionado

La actualidad más candente

Experience Manager 6 Developer Features - Highlights
Experience Manager 6 Developer Features - HighlightsExperience Manager 6 Developer Features - Highlights
Experience Manager 6 Developer Features - HighlightsCédric Hüsler
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeAcquia
 
You Tube Video Link
You Tube Video LinkYou Tube Video Link
You Tube Video Linkdewriter
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Eugenio Minardi
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and RenderingStoyan Stefanov
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateLaura Scott
 
Vídeo.1
Vídeo.1Vídeo.1
Vídeo.1home
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build themDick Olsson
 

La actualidad más candente (10)

Css multi background
Css   multi backgroundCss   multi background
Css multi background
 
Experience Manager 6 Developer Features - Highlights
Experience Manager 6 Developer Features - HighlightsExperience Manager 6 Developer Features - Highlights
Experience Manager 6 Developer Features - Highlights
 
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 ThemeCreating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
 
You Tube Video Link
You Tube Video LinkYou Tube Video Link
You Tube Video Link
 
The web context
The web contextThe web context
The web context
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)
 
Progressive Downloads and Rendering
Progressive Downloads and RenderingProgressive Downloads and Rendering
Progressive Downloads and Rendering
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
 
Vídeo.1
Vídeo.1Vídeo.1
Vídeo.1
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build them
 

Destacado

Visual Programming
Visual ProgrammingVisual Programming
Visual ProgrammingBagzzz
 
1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessortechbed
 
Phy i assign&answers_2011
Phy i assign&answers_2011Phy i assign&answers_2011
Phy i assign&answers_2011Sufi Sulaiman
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architectureprasadpawaskar
 

Destacado (8)

Roadmap 2018 - VPL in Iceland
Roadmap 2018 - VPL in IcelandRoadmap 2018 - VPL in Iceland
Roadmap 2018 - VPL in Iceland
 
Kid Safe Democracy Work
Kid Safe Democracy WorkKid Safe Democracy Work
Kid Safe Democracy Work
 
Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
 
Memory mgmt 80386
Memory mgmt 80386Memory mgmt 80386
Memory mgmt 80386
 
1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor
 
Phy i assign&answers_2011
Phy i assign&answers_2011Phy i assign&answers_2011
Phy i assign&answers_2011
 
Secondary Memory
Secondary MemorySecondary Memory
Secondary Memory
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 

Similar a Experion Presentation at JavaOne 2011: Memory optimizing Java ME applications

Responsive Websites
Responsive WebsitesResponsive Websites
Responsive WebsitesJoe Seifi
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
Nanoformats
NanoformatsNanoformats
Nanoformatsrozario
 
Top 10 HTML5 features
Top 10 HTML5 featuresTop 10 HTML5 features
Top 10 HTML5 featuresGill Cleeren
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX DesignersAshlimarie
 
Practical Responsive Images - from Second Wednesday
Practical Responsive Images - from Second WednesdayPractical Responsive Images - from Second Wednesday
Practical Responsive Images - from Second WednesdayBen Seymour
 
Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Andreas Bovens
 
SharePoint 2010 Training Session 6
SharePoint 2010 Training Session 6SharePoint 2010 Training Session 6
SharePoint 2010 Training Session 6Usman Zafar Malik
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. The University of Akron
 
Presentation html5 css3 by thibaut
Presentation html5 css3 by thibautPresentation html5 css3 by thibaut
Presentation html5 css3 by thibautThibaut Baillet
 
KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天tblanlan
 
kissy-past-now-future
kissy-past-now-futurekissy-past-now-future
kissy-past-now-futureyiming he
 
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use TodayHTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use TodayTodd Anglin
 
gDayX - Advanced angularjs
gDayX - Advanced angularjsgDayX - Advanced angularjs
gDayX - Advanced angularjsgdgvietnam
 
Building iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360FlexBuilding iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360Flexdanielwanja
 
Responsive Design: Mehr als CSS
Responsive Design: Mehr als CSSResponsive Design: Mehr als CSS
Responsive Design: Mehr als CSSWalter Ebert
 
20190118_NetadashiMeetup#8_React2019
20190118_NetadashiMeetup#8_React201920190118_NetadashiMeetup#8_React2019
20190118_NetadashiMeetup#8_React2019Makoto Mori
 
Responsive WordPress workflow
Responsive WordPress workflowResponsive WordPress workflow
Responsive WordPress workflowJames Bundey
 
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5Cengage Learning
 

Similar a Experion Presentation at JavaOne 2011: Memory optimizing Java ME applications (20)

Responsive Websites
Responsive WebsitesResponsive Websites
Responsive Websites
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Nanoformats
NanoformatsNanoformats
Nanoformats
 
Top 10 HTML5 features
Top 10 HTML5 featuresTop 10 HTML5 features
Top 10 HTML5 features
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Practical Responsive Images - from Second Wednesday
Practical Responsive Images - from Second WednesdayPractical Responsive Images - from Second Wednesday
Practical Responsive Images - from Second Wednesday
 
Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...Responsive design: techniques and tricks to prepare your websites for the mul...
Responsive design: techniques and tricks to prepare your websites for the mul...
 
SharePoint 2010 Training Session 6
SharePoint 2010 Training Session 6SharePoint 2010 Training Session 6
SharePoint 2010 Training Session 6
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
Create a landing page
Create a landing pageCreate a landing page
Create a landing page
 
Presentation html5 css3 by thibaut
Presentation html5 css3 by thibautPresentation html5 css3 by thibaut
Presentation html5 css3 by thibaut
 
KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天KISSY 的昨天、今天与明天
KISSY 的昨天、今天与明天
 
kissy-past-now-future
kissy-past-now-futurekissy-past-now-future
kissy-past-now-future
 
HTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use TodayHTML5 and CSS3 Techniques You Can Use Today
HTML5 and CSS3 Techniques You Can Use Today
 
gDayX - Advanced angularjs
gDayX - Advanced angularjsgDayX - Advanced angularjs
gDayX - Advanced angularjs
 
Building iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360FlexBuilding iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360Flex
 
Responsive Design: Mehr als CSS
Responsive Design: Mehr als CSSResponsive Design: Mehr als CSS
Responsive Design: Mehr als CSS
 
20190118_NetadashiMeetup#8_React2019
20190118_NetadashiMeetup#8_React201920190118_NetadashiMeetup#8_React2019
20190118_NetadashiMeetup#8_React2019
 
Responsive WordPress workflow
Responsive WordPress workflowResponsive WordPress workflow
Responsive WordPress workflow
 
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
Course Tech 2013, Sasha Vodnik, A Crash Course in HTML5
 

Último

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

Experion Presentation at JavaOne 2011: Memory optimizing Java ME applications

  • 1. Memory Optimizing Java ME applications Sreekumar Pillai , CTO, Experion
  • 2. Java ME Platform § Java ME devices often are consumer devices which has resource constraints § Mobile devices are not small PCs § Applications are to make best use of the available resources § Development requires a different mindset which expects unexpected things !
  • 3. Why memory optimization? § Functionality is often given priority in initial phases of development § Performance tuning takes a backseat and generally developers ignore efficient usage of memory § Memory issues are hard to fix § In Java ME this can be fatal and midlet may not run at all
  • 4. Java ME Enterprise applications § Enterprise applications are mostly used by staff to perform operations while they are on Field § Typically such applications require to connect to a backend server for data access § Volume of data can be a bottleneck and requires careful design and optimization
  • 5. Java ME Memory architecture § Automatic memory management is part of JVM § Heap -  Heap is created by JVM at startup -  Class instances are allocated in Heap -  Size of Heap is typically fixed to 2Mb (low end devices) § Garbage Collection -  JVM Specification mandates a garbage collection mechanism -  Programmer is not allowed to explicitly deallocate the memory of an object
  • 6. Garbage collection § There is no concept of a pointer in Java § Memory management is left to JVM § GC is provided by JVM to reclaim the unreferenced memory § An object is eligible for garbage collection if it can not be accessed by any live thread
  • 7. Detecting memory issues § Exceptions -  JVM Throws OutOfMemoryError -  When trying to allocate more memory than available as a single chunk § Memory Profiler -  See the objects being allocated and the memory they occupy -  Set the available amount of memory and stress the application
  • 10. How do we optimize ?
  • 11. Object allocations § Use as few as possible § Dereference objects(set to NULL) to enable GC § Reuse objects § Heap fragmentation -  See the possibility of doing large allocations first § Catch OutOfMemoryError for large allocations
  • 12. Reorganize UI Navigation § Having more UI elements in a single screen increases the memory requirment § Good to reduce the data presented in a single screen § Long lists & scrolling does not result in good user experience § Split the data into multiple screens ( e.g. a product catalogue can be splitted into category, sub category, and item screens )
  • 13. Data representations § XML -  XML is suitable for hierarchical data like a product catalogue -  XML is lengthy and occupies more bandwidth § JSON -  Simple than XML -  More popular among developers § CSV / Custom Fixed length -  Full control over data format and parsing
  • 14. XML Vs JSON <widget> {"widget": { <debug>on</debug> "debug": "on", "window": { <window title="Sample Konfabulator Widget"> "title": "Sample Konfabulator Widget", <name>main_window</name> "name": "main_window", <width>500</width> "width": 500, <height>500</height> "height": 500 </window> }, "image": { <image src="Images/Sun.png" name="sun1"> "src": "Images/Sun.png", <hOffset>250</hOffset> "name": "sun1", <vOffset>250</vOffset> "hOffset": 250, <alignment>center</alignment> "vOffset": 250, "alignment": "center" </image> }, <text data="Click Here" size="36" style="bold"> "text": { <name>text1</name> "data": "Click Here", <hOffset>250</hOffset> "size": 36, <vOffset>100</vOffset> "style": "bold", <alignment>center</alignment> "name": "text1", "hOffset": 250, <onMouseUp> "vOffset": 100, sun1.opacity = (sun1.opacity / 100) * 90; "alignment": "center", </onMouseUp> "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" </text> } </widget> }}
  • 15. Optimizing XML / JSON § Reduce size of tags / keys § <Product code>PT1432</Product code> § Reduce the number of fields required in client side -  Very generalized web services is an overhead for client applciations § Parsers are memory intensive - For large data strings alternate options to be considered
  • 16. RMS - Alternate storage § RMS RecordStore can be used for storing data when size is high § RecordStore can be addressed using a name tag § Organize data – Read required information into memory
  • 17. JAR Size § Reduce size of classes -  Use an obfuscator to minimize the size of classes § Themes -  Do you require multiple themes ? § Images -  Minimize resource sizes -  Use fewer colors as possible