I have critical low storage level and can't understand what takes much of it and how that's possible that the installed applications can use 7 GB? I only use a few social media clients without any games or soft like Photoshop. Also on the second screenshot it indicates that the apps are using just 1.13 GB and so I can't understand the situation. Also what is the "Other"?
4 Answers
Android's filesystem hierarchy is a bit complex and people often find it difficult to grasp. A major reason for confusion is that Android isn't very expressive in explaining these things and it's not very clear which files Android put in which category. Another reason is that mostly devices are not rooted and users don't have access to filesystems to verify the things themselves. We can try to understand it from root.
VIDEOS, PICTURES, AUDIO AND "OTHER":
Android uses file extensions to decide if a file in Public Shared / External Storage (i.e. /sdcard
excluding the private directories of apps) is video, picture or audio. This header file defines a mapping between file extensions and categories. Further details can be found in this answer.
Simply put, we can use file extensions to categorize files and calculate their size:
~$ find -H /sdcard/ -type f ! -path '/sdcard/Android*' | grep -iE '\.3g2$|\.3gp$|\.3gpp$|\.3gpp2$|\.asf$|\.asx$|\.avi$|\.dif$|\.dl$|\.dv$|\.fli$|\.lsf$|\.lsx$|\.m4v$|\.mkv$|\.mng$|\.mov$|\.movie$|\.mp4$|\.mpe$|\.mpeg$|\.mpg$|\.mxu$|\.qt$|\.ts$|\.vob$|\.webm$|\.wm$|\.wmv$|\.wmx$|\.wrf$|\.wvx$' | xargs -I {} du -b '{}' | sort -n | awk '{sum += $1} {print} END {print sum}'
...
75696063 /sdcard/DCIM/Camera/VID_20190726_190531.mp4
97849262 /sdcard/DCIM/Camera/VID_20190721_142818.mp4
331238039 /sdcard/TIMELAPSE OF THE FUTURE_ A Journey to the End of Time (4K).mp4
1554180683
So I have 1.55 GB of videos on my /sdcard
.
~$ find -H /sdcard/ -type f ! -path '/sdcard/Android*' | grep -iE '\.art$|\.arw$|\.bmp$|\.cr2$|\.dng$|\.gif$|\.jng$|\.jpe$|\.jpeg$|\.jpg$|\.nef$|\.nrw$|\.orf$|\.pbm$|\.pcx$|\.pef$|\.pgm$|\.png$|\.pnm$|\.ppm$|\.psd$|\.ras$|\.rgb$|\.rw2$|\.srw$|\.svg$|\.svgz$|\.tif$|\.tiff$|\.wbmp$|\.webp$|\.xbm$|\.xpm$|\.xwd$' | xargs -I {} du -b '{}' | sort -n | awk '{sum += $1} {print} END {print sum}'
...
31944 /sdcard/.recycle/1565980569828.3/2080952923/Screenshot_20190816-155104_Firefox.png
34099 /sdcard/OLD_sdcard/Download/iptables_overview.jpg
6839118 /sdcard/DCIM/Camera/PANO_20190421_132245.jpg
7726000 /sdcard/DCIM/Camera/IMG_20181123_144811.jpg
669063808
And 669 MB of pictures. Combined with videos it becomes 2.22 GB.
~$ find -H /sdcard/ -type f ! -path '/sdcard/Android*' | grep -iE '\.aac$|\.aif$|\.aifc$|\.aiff$|\.amr$|\.awb$|\.flac$|\.gsm$|\.m3u$|\.m4a$|\.mka$|\.mp2$|\.mp3$|\.mpega$|\.mpga$|\.oga$|\.ogg$|\.pls$|\.ra$|\.ram$|\.rm$|\.sd2$|\.snd$|\.wav$|\.wax$|\.wma$' | xargs -I {} du -b '{}' | sort -n | awk '{sum += $1} {print} END {print sum}'
...
196556 /sdcard/OLD_sdcard/Alarms/Freedom.ogg
451614 /sdcard/OLD_sdcard/CallRecordings/0507189091_190225_191938461.amr
5652322 /sdcard/.recycle/1564398739475.3/710629278/L'Orfeo(preview).mp3
186868393
And 187 MB of audios. Now total space taken by files:
~$ du -bs --exclude=/sdcard/Android /sdcard/
5330784600 /sdcard/
It's 5.3 GB. Subtracting video, pictures and audio, it's 2.89 GB which is the size of "Other"; shown as "Files" on my device:
Non-root part is over here. Next to explore the /data
partition you need root access. First to make it clear, throughout the whole life of a device, a common user interacts only with one partition labeled userdata
. But it's not very uncommon to have 50+ partitions on Android devices (details can be seen in this thread). So here we are talking about the space usage on userdata
partition which is mounted at /data
. One of its sub-directory /data/media/0
is the one we see in file explorers or at /sdcard
or at /storage/emulated/0
. See What is /storage/emulated/0? for details.
TOTAL SPACE USAGE:
Now have a look at space usage reported by Android. It says 16.73 GB out of 32 GB are used. Let's analyze.
~# cat /sys/block/mmcblk0/size
61071360
~# df -B1 --output=size /data
1B-blocks
25762942976
Note: Don't confuse the units. 61071360 sectors equal 31268536320 bytes, which equal 31.27 Gigabytes (GB) or 29.12 Gibibyte (GiB).
Total available size of eMMC is 31.27 GB (ignoring e.g. RPMB and provisioned space etc.) and size of /data
filesystem is 25.76 GB (See! I thought it would be 32.00 GiB). It means that 5.5 GB space was occupied when the device was shipped from the factory. It's mainly taken by the system
, vendor
and cache
partitions, and a small part by other partitions. Partition table takes a few KBs but there are possibly a few MBs left free in between partitions, some space is wasted due to encryption, and so on. Following screenshot shows the complete partition table:
(Click image for enlarged view)
Now coming to the used space:
~# df -B1 --output=used /data
Used
10407436288
~# du -b -d1 /data | sort -n
...
30932548 /data/system
89343105 /data/user_de
252376438 /data/dalvik-cache
1537995332 /data/app
1817762284 /data/data
5460784600 /data/media
9250761612 /data
Space usage reported by filesystem is 10.4 GB, while the apparent size of files is 9.25 GB. This difference of 1.15 GB could be variable and is used by the filesystem. Details can be found in this answer. May be a part of it is being used by f2fs
log structure on my device.
So total used space on device is 15.9 GB (5.5 and 10.4) out of 31.27 GB. Note the difference with the values in screenshot. The difference in total size could be because of rounding-off the sum of /data
and /system
to the nearest power of 2.
APPS SPACE USAGE:
5.3 GB out of 9.25 GB is used by the public files in /sdcard
as explained in the start. Rest of the 3.95 GB space is mainly taken by three categories of files. Keeping things simple, following are the major directories which sum up to total app size (1, 2, 3, 4):
App size /data/app/<pkg>*
/data/dalvik-cache/<arch>/<pkg's_dex_odex_vdex_art_oat>
/storage/emulated/<user_id>/Android/obb/<pkg>
/data/misc/profiles/ref/<pkg>
Cache /data/user/<user_id>/<pkg>/*cache
/data/user_de/<user_id>/<pkg>/*cache
/storage/emulated/<user_id>/Android/data/<pkg>/*cache
User data /data/user/<user_id>/<pkg>
/data/user_de/<user_id>/<pkg>
/storage/emulated/<user_id>/Android/data/<pkg>
/storage/emulated/<user_id>/Android/media/<pkg>
/data/misc/profiles/cur/<user_id>/<pkg>
- User data size should exclude Cache size.
- For user apps compiled binary files are stored in installation directory (
/data/app/<pkg>/oat/<arch>
) since Lollipop. But for system apps those are saved to/data/dalvik-cache
which is counted for apps size. Actual.apk
files of system apps are not counted, except if an app is updated..odex
files for Android's framework apps (.apk
/.jar
) however might be already stored in/system/framework/
having only symlinks in/data/dalvik-cache/
. Things have changed with A/B implementation. - For more details see Where Android apps store data?
Taking sum of all these directories:
~# du -sb /data/app /data/misc/profiles/ /data/dalvik-cache/ /storage/emulated/*/Android/ /data/user/*/ /data/user_de/ | sort -n | awk '{sum += $1} {printf "%-15s%s\n",$1,$2} END {print sum}'
94152 /storage/emulated/11/Android/
611998 /data/misc/profiles/cur/10/
837897 /storage/emulated/10/Android/
1013850 /data/misc/profiles/cur/0/
1109311 /storage/emulated/0/Android/
1602419 /data/misc/profiles/ref/
3294944 /data/user_de/10/
10283019 /data/user/10/
86048161 /data/user_de/0/
252376438 /data/dalvik-cache/
1537995332 /data/app
1817762284 /data/user/0/
3713029805
It's 3.7 GB, leaving only 250 MB behind, some of which is taken by the /sdcard
of other two user profiles (/data/media/<user_id>
). The rest is used by system logs and configuration files, particularly in /data/system*
and /data/misc*
directories.
This system usage is shown as "System" which excludes shared storage size (5, 6). Some figures differ from Android but after all we know how the space is actually used, and where it's being wasted.
RELATED:
-
Great answer. Upvoted. Do you know why Android devices may have 50+ partitions? Shall I post a question to ask just this? Commented Jun 26, 2022 at 22:22
-
@RockPaperLz-MaskitorCasket because Android is designed this way. Every partition has a purpose. Many of them have a backup partition too, which increases the number. This was one of my initial attempts to understand this. Commented Jul 19, 2022 at 8:22
As far as I understood the apps take so much space because of cache files, additional data, backups, photos, videos and etc. Size that shown in App Cleaner is just about the size of .apk files without any other related data and files to those apps. It is all cleanable but could cause the loss of the information and unpredicted behavior of an app.
Originally question was made because I was looking for methods to free up some space on my device so here is another way that I found:
After clearing Download Manager's data my disk space on the phone got relief of 3.3GB.
And the interesting thing is that the apps and phone behavior is not affected after this, so much space were used in vain.
The right screenshot seems to originate form an app named "Cleaner". Apps on Android can not access app-private data (files in the path /app/data/<apppackagename>/
) of other apps, therefore an app can never estimate the data size correctly.
I assume "App uninstall" shown in Cleaner is the pure size of all app APK files (those are visible to all apps). Therefore most of the files crate by apps are invisible to Cleaner. It can only see the files on the sdcard section.
The fact that you don't use games has no bearing on the amount of storage space other apps use. You mentioned that you use social media apps. Then you should know that many (if not most) of them keep caches of files (mainly pictures, videos) you viewed to present them quickly in case you visit the same pages again. With time, the storage space they occupy grow more than many other apps. Other apps that can also use a lot of space are browsers.
You should check the amount of storage used by individual apps to have better understanding of which among them use a lot of space.
What is the "Other"?
It can be documents and any other files that does not fall under pictures, videos, apps, not found on the system partition. On my phone, Other is defined as:
files downloaded from the internet or Bluetooth, Android files, and so on.