is there a maximum size to android internal storage allocated for an app? is there a maximum size to android internal storage allocated for an app? android android

is there a maximum size to android internal storage allocated for an app?


If you use Environment.getExternalStorageDirectory() (or Context.getExternalFilesDir() for API level 8 and up) as the place for your json file, then I believe the size will be limited by the available space in the external storage (usually an SD card). For most devices, I believe there are no fixed limits built into Android for external file storage. (Internal storage is a different matter. Device manufacturers can impose quite restrictive limits, perhaps as low as 100MB shared among all applications.)

UPDATE: Note that according to the compatibility definition for Android 2.3 (Section 7.6.1), devices should have quite a bit of memory:

Device implementations MUST have at least 150MB of non-volatile storage available for user data. That is, the /data partition MUST be at least 150MB.

Beyond the requirements above, device implementations SHOULD have at least 1GB of non-volatile storage available for user data. Note that thishigher requirement is planned to become a hard minimum in a future version of Android. Device implementations are strongly encouraged to meetthese requirements now, or else they may not be eligible for compatibility for a future version of Android.

This space is shared by all applications, so it can fill up. There is no guaranteed minimum storage available for each app. (Such a guaranteed minimum would be worthless for apps that need to store more than the minimum and would be a waste for apps that store less.)

Edit: From the compatibility definition for Android 4.0

Device implementations MUST have at least 350MB of non-volatile storage available for user data. That is, the /data partition MUST be at least 350MB.

From the compatibility definition for Android 4.3

Device implementations MUST have at least 512MB of non-volatile storage available for user data. That is, the /data partition MUST be at least 512MB.

Interestingly, the recommendation that implementations SHOULD provide at least 1GB has stayed the same.


I've never witnessed it limit a single application, and I have tested it with saving some rather large (200 mb) video files in the app Files dir before.

For internal storage I think your only limited by the amount of internal storage made available for all applications to share. Which as @Ted Hopp mentioned is rather small on some of the older and lower end devices. But on the newer and higher end devices they've started bumping it up to a reasonable amount, though even if the device has a lot of space, it could still be taken up by other applications(so you need to test what will happen in this scenario).

It is also worth pointing out that if you use external storage such as the SD card then your json file would technically editable by the user. They could open it up in a text editor and start changing the raw values if they had any desire to. (This is also possible if you choose to use internal storage, but it would require a rooted device, whereas if it is stored on the SD card would not require root)

So if you are storing info that you'd rather the user not have the option to manually edit, you may want to take that into consideration.


I think there is a hard limit of about 3.61GB.

I currently have termux installed on my tab. Termux runs a linux terminal where i can install nodejs and npm. Thereby essentially creating a development environment. I have installed packages without much space-related problems except when my device's internal memory is realy low. But as of recent. I think I have reached that limit, which brought me to this question and hit on this page.

My device storage is way beyond 1GB and I have used it with space as low as 200MB without this issue. But my termux installation has grown to 3.61GB. I recently started with yarn and it seems like yarn is a space hog. I was installing a package and it suddenly logged: error Could not write file "/data/data/com.termux/files/home/dev/ide/theia/yarn-error.log": "ENOSPC: no space left on deviceSo it crushed the installation and thought i really ran out of space, but I hadn't. Further inspection shows that i still have the aforementioned space in internal storage and yarn has hogged 750MB, of which npm only about 500MB in cache. I have been using npm since, but just needed to use yarn as the installation for Theia wasn't finishing well with npm. Theia seems to be using yarn as their package manager. So 3.61GB hints to be the hard limit for app + data.

Removing some packages and reducing some space used by other redundant packages, I gain space to create files and install as I please, but as soon as I reach 3.61GB again!!! boom!!! that's it, I can't create any files anymore.

I don't think this is well-documented, but it is happening.

I am using lollipop (android 5.1)

To assert this, someone else should try to use an app that creates really large files in its internal sandbox. Not in the internal storage, but in its private data area. I am sure you will likely hit this hard-limit.