DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Android Dalvik GC Log Analysis

Android Dalvik GC Log Analysis

Your mobile app's memory usage impacts the user experience. Gain a better understanding of how memory usage is logged and what it can tell you.

Ram Lakshmanan user avatar by
Ram Lakshmanan
CORE ·
May. 19, 17 · Opinion
Like (1)
Save
Tweet
Share
3.39K Views

Join the DZone community and get the full member experience.

Join For Free

Memory utilization on a mobile app has a significant impact on the customer experience. If your app creates a lot of objects, then the Garbage Collection (GC) process will be triggered frequently to evict unused objects. Even though Garbage Collection is an automatic process, however, frequent Garbage Collection consumes a lot of CPU, and it will also pause the app. Frequent pauses can mess up the app (e.g. stuttering or halting).

Thus, you need to understand how many objects your app is creating, how frequently Garbage Collection is triggered, how much time it takes to complete, and how much memory is reclaimed after every event. All this information is present in the runtime log messages. Whenever a GC event runs, a log line is printed in the runtime log messages. You can view those log lines through logcat.

GC log line format varies based on whether app runs on Dalvik VM or Android Run Time (ART). In an earlier article, we saw how to analyze ART GC log lines. Now let’s see how to analyze a Dalvik GC log line.

This is how a typical Dalvik GC log line will look:

Image title

This one single log line has multiple fields. Below table summarizes each field in detail:

 

#

Field Value Description
1 Timestamp 07-01 15:56:19.815 Timestamp at which this Garbage Collection event ran
2 GC Reason GC CONCURRENT Reason why Garbage Collection event was triggered. Please refer here for different types of GC Reasons.
3 Objects freed 7078K Amount of objects garbage collected. Totally 7078kb of objects are garbage collected (i.e. freed) in this event.
4 Heap usage 52464K/ 89052K 52464kb of objects are alive after this particular GC event. Total allocated heap size for this app is 89052 kb.
5 GC Pause Time 14ms+4ms During certain phases of GC event, application is paused. In this GC event, pause time is 18 ms (i.e. 14 + 4 ms). During pause time, application freezes. One should target for low pause time.
6 GC Total Time 96ms Amount of time this GC event took to complete. It includes the GC Pause time as well.

Tools

As it might get tedious to analyze every single GC log line, you can also consider using free online tools such as GCeasy.io – a universal Garbage collection log analyzer, to analyze Android GC logs. You can just upload the Android GC Logs to this tool. Tool parses GC log and generates report instantly. Report contains interactive graphs and insightful metrics. A few excerpts from this report are given below for your reference.

Image title

Fig 1: Android memory usage – report generated by GCeasy.io.

Image title

Fig 2: KPI – report generated by GCeasy.io.

garbage collection Android (robot) Dalvik (software) Log analysis mobile app Garbage (computer science) Event

Published at DZone with permission of Ram Lakshmanan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Key Elements of Site Reliability Engineering (SRE)
  • DevOps for Developers: Continuous Integration, GitHub Actions, and Sonar Cloud
  • Create Spider Chart With ReactJS
  • HTTP vs Messaging for Microservices Communications

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: