Just An Application

May 20, 2012

Adventures In Distributed Garbage Collection: Part Nine – Post Bind Service Client State

Filed under: Android, Android Internals, Java, Mobile Java, Services — Tags: , , , , — Simon Lewis @ 6:00 am

1.0 Object State

We can use the source code to derive a diagram which shows the Service related objects which should exist in the Service client process and their
relationships following a successful call to bindService().

2.0 Java Heap State

We can use the state of the Java heap of the Service client process following the call to bindService() to check whether the code that runs
is actually doing what we think it is.

We can obtain a dump of the Java heap state and examine it interactively using a tool like MAT.

Alternatively we can generate a graph from the dump of the Java heap state which shows the relationships between the objects graphically.

This graph was generated using the LoadedApk object [0x40513e90] as the root.

The greyed out nodes have been filtered, that is, one or more instance variables have been omitted. This makes the graph a bit less complicated.

Although it is not exactly obvious the following objects are present in the generated object graph as expected

  • ServiceDispatcher [0x405213b8]

  • ConnectionInfo [0x40521b40]

  • InnerConnection [0x405216b8]

  • FastnetServiceConnection [0x405211f0]

and the relationships between them are also as expected.


Copyright (c) 2012 By Simon Lewis. All Rights Reserved.

Advertisements

2 Comments »

  1. […] in the Service client case we can use the source code to derive a diagram which shows the Service related objects which […]

    Pingback by Adventures In Distributed Garbage Collection: Part Ten – Post Bind Service State « Just An Application — May 21, 2012 @ 6:00 am

  2. […] in the Service client and Service cases we can use the source code to derive a diagram which shows the Service related […]

    Pingback by Adventures In Distributed Garbage Collection: Part Eleven – Post Bind System Process State « Just An Application — May 22, 2012 @ 6:02 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: