How to Inspect Shared Data Blobs and Model Leases on Android Using ADB dumpsys blob_store

Modern mobile applications increasingly incorporate on-device machine learning (ML), natural language processing models, offline translation datasets, and large multimedia dictionaries. When multiple apps independently download identical multi-hundred-megabyte TensorFlow Lite or PyTorch models, device flash storage is rapidly squandered, leading to low-storage warnings and redundant cellular data consumption. To eliminate this redundancy, Android provides the BlobStoreManager system service (introduced in Android 11 / API 30). BlobStoreManager enables cryptographic, cross-app data sharing using SHA-256 digests. Using the Android Debug Bridge (ADB), developers and performance engineers can query dumpsys blob_store to audit cached blobs, leaseholders, and storage quotas.

Understanding Android BlobStoreManager Architecture

The BlobStoreManager acts as a centralized, secure data cache operating beneath standard application sandboxes:

  • Content-Addressed Storage: Data objects (blobs) are identified exclusively by their cryptographic SHA-256 hash. Two apps referencing the same hash point to the identical physical file in the system blob repository (located under /data/system/blob_store/).
  • Lease-Based Lifecycle Management: An application that requires access to a blob acquires a lease, specifying an expiration timestamp and a description of why the data is needed. As long as at least one active lease exists, Android protects the blob from garbage collection.
  • Access Control Modes: Blob creators can restrict sharing to apps signed with the same certificate (signature-level), allow explicit package whitelists, or permit open access to any application possessing the matching SHA-256 hash.
  • Automatic Storage Reclaim: When all leases on a blob expire or when the device encounters severe storage pressure, Android’s storage manager automatically purges unreferenced blobs.

Connecting via ADB and Querying blob_store

Ensure that USB debugging is active under Developer Options and verify connectivity from your command line:

# Check active ADB connections
adb devices

# Dump the full BlobStoreManager service state
adb shell dumpsys blob_store

The output provides an exhaustive inventory of stored blobs, active sessions, acquiring packages, and storage consumption.

Auditing Stored Blobs and SHA-256 Digests

To inspect active data blobs currently cached in the system store, examine the Blobs: section of the dump:

# Extract active stored blobs and their identifiers
adb shell dumpsys blob_store | grep -A 15 "Blobs:"

Each entry exposes detailed cryptographic and storage metrics:

  • Blob ID: The internal numeric handle assigned by the system service.
  • SHA-256 Digest: The cryptographic checksum identifying the content.
  • Size: Total file size in bytes (e.g., 145829120 bytes for a ~140 MB model).
  • Label / Tag: An optional human-readable tag or URI provided during initial contribution.

Inspecting Active App Leases and Quotas

To identify which applications currently hold leases on a blob and prevent it from being deleted, filter for the lease records:

# Query active leases across all cached blobs
adb shell dumpsys blob_store | grep -A 10 "Leasees:"

The lease attributes detail:

  • Package Name: The Android package holding the lease (e.g., com.google.android.as or a third-party ML client).
  • UID: The Linux user identifier of the executing process.
  • Expiry Time: Epoch millisecond timestamp indicating when the app’s lease will expire.
  • Description: A human-readable justification provided by the developer explaining why the blob is required.

Android also enforces per-package storage quotas on leased blobs to prevent malicious apps from pinning excessive data to storage:

# Inspect remaining blob storage quota for a specific UID
adb shell cmd blob_store query-quota-stats --uid 10214

Monitoring In-Progress Blob Commit Sessions

When an application writes a new blob to the store, it creates an intermediate session before committing the data. If a download stalls or an app crashes during transfer, orphaned sessions may consume temporary disk space:

# Inspect active or uncommitted blob sessions
adb shell dumpsys blob_store | grep -A 8 "Sessions:"

Sessions that remain open without active byte progression indicate network timeouts or background process terminations. Android’s idle cleanup handler purges uncommitted sessions older than 48 hours.

Clearing and Managing Blobs in Testing Environments

During mobile app automated testing and benchmarking, developers need to simulate cache misses by purging cached blobs. Android exposes command-line service handles via cmd blob_store:

# List available blob_store command utilities
adb shell cmd blob_store -h

# Manually trigger idle maintenance to sweep expired blobs
adb shell cmd blob_store run-idle-maintenance

If an app needs to be tested under fresh download conditions, clearing the application’s app data (adb shell pm clear <package>) revokes all its active leases, allowing run-idle-maintenance to reclaim the underlying flash space.

Inspecting adb shell dumpsys blob_store provides mobile developers and system architects with full transparency into shared memory models, eliminating storage duplication and streamlining multi-app machine learning deployments on Android.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.