---
title: "Open PDF from in-memory data on Android | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/android/open-a-document/from-in-memory-data/"
md_url: "https://www.nutrient.io/guides/android/open-a-document/from-in-memory-data.md"
last_updated: "2026-06-08T09:14:14.293Z"
description: "Learn to open PDFs from in-memory data on Android while avoiding memory issues and ensuring data persistence across process recreations using Nutrient Android SDK."
---

# Open PDFs from in-memory data on Android

In most cases, it’s best to serve your PDF data from some kind of random-access storage — usually a file. Keeping your PDF data solely in memory has two major disadvantages:

- It can quickly lead to `OutOfMemoryException` situations. This can happen when you don’t have full control over the size of your PDFs (e.g. when a user opens a big PDF) or when running your app on a device with less memory than anticipated.

- An in-memory data provider can’t be retained across [process recreations](https://developer.android.com/guide/components/activities/process-lifecycle.html). By design, Android can kill your app’s process as soon as all activities of your app are in the background. Once the app comes to the foreground, your process is recreated, leaving your in-memory data provider without data.

Due to these reasons, the previously available `MemoryDataProvider` was removed in [Nutrient Android SDK 3.1.1](https://www.nutrient.io/guides/android/changelog.md#3.1.1). Depending on your original usage scenario, you’re advised to use one of the other available data provider classes.
---

## Related pages

- [Open PDFs from a custom data provider on Android](/guides/android/features/data-providers.md)
- [Open a PDF file from Document Engine on Android](/guides/android/open-a-document/from-document-engine.md)
- [Open a local PDF file on Android](/guides/android/open-a-document/from-local-storage.md)
- [Open PDF files on Android](/guides/android/open-a-document.md)
- [Open password-protected PDFs on Android](/guides/android/security/secured-documents.md)
- [Open PDFs from URLs on Android](/guides/android/miscellaneous/document-downloads.md)

