Owners of devices based on Android periodically face a situation when the free space in the phoneโs memory begins to rapidly decrease for no apparent reason. When performing a detailed analysis of the file system using explorers, many discover mysterious objects with names like thumbdata3--1967290299 or thumbdata4, occupying gigabytes of disk space. These files are part of the system's mechanism for caching image thumbnails, which is built directly into the operating system.
The essence of the problem is that the standard mechanism for clearing the cache through the smartphone settings often does not affect these specific archives, continuing to accumulate data about viewed thumbnails. Understanding the structure of work Media Store and compression algorithms allows the user not only to free up memory, but also to prevent re-bloat of system folders in the future.
In this article we will analyze in detail the nature of the occurrence of files thumbdata, consider methods for their safe deletion and discuss the technical nuances of working with the thumbnail database. You will learn why deleting these files does not lead to the loss of original photos and how to properly configure the device to optimize media storage.
The nature and purpose of thumbdata files
Files with a prefix thumbdata are specialized databases that the operating system Android uses to speed up gallery display. When you open the Gallery app or any file manager with a preview, the system does not regenerate the thumbnail of each image each time you enter. Instead, it accesses a pre-prepared cache stored in these binary files.
The process of creating thumbnails occurs in the background by the service Media Scanner. As soon as a new image gets onto the memory card or internal storage, the scanner analyzes it, creates a small, low-resolution copy and writes a link to it in the database thumbdata. This allows the interface to work smoothly, even if there are thousands of high-resolution photos in the folder.
The numbers in the file name following the hyphen (for example, thumbdata3--1967290299) are hashes or identifiers of the volume to which the cache is attached. This is done so that the system can distinguish thumbnails for different memory sections or users. Google and shell manufacturers are constantly improving compression algorithms, so the format of these files may change from version to version.
โ ๏ธ Attention: The files
thumbdataare located in a hidden system folder.thumbnails. To access them, you will need a file manager that supports showing hidden elements or superuser rights (Root).
Despite its usefulness, the mechanism of this cache is often criticized by optimization experts. The problem is that there is no automatic limit on the size of the database. If you're actively viewing photos or videos, the file can grow to tens of gigabytes, taking up space that could be used to install applications or save new documents.
If you notice a sudden increase in the size of your thumbdata file in a short time, check to see if your gallery has enabled thumbnail grid view of video files - this is the most resource-intensive operation for the cache.
Storage structure and location in the file system
Traditionally, thumbnail data was located along the path /sdcard/DCIM/.thumbnails. However, starting with version Android 4.4 KitKat and especially in more modern versions (Android 10, 11, 12+), the security policy Scoped Storage changed the approach to accessing files. Now this data is often migrated to protected system partitions, such as /data/data/com.android.providers.media/databases or /storage/emulated/0/Android/data/com.android.providers.media/files.
In older versions of the OS, files thumbdata were easily accessible to any user through a standard explorer. In modern realities, without obtaining root access or using debugging USB (ADB) direct access to these files may be blocked by the system. This is done to protect the integrity of the media provider database from accidental damage by third-party applications.
Below is a table showing the evolution of the location of cache files depending on the operating system version:
| Android version | Typical path to files | Access without Root |
|---|---|---|
| Android 4.0 - 4.3 | /sdcard/DCIM/.thumbnails |
Full access |
| Android 4.4 - 9.0 | /sdcard/DCIM/.thumbnails or /data/data/... |
Partial access |
| Android 10+ | /data/data/com.android.providers.media/... |
Closed (ADB/Root required) |
It is important to understand that the contents of the folder .thumbnails are not static. It is dynamically updated. When the original image is deleted, the system should update the thumbnail database accordingly, but in practice this synchronization process sometimes fails, leaving โdead weightโ in the form of orphaned entries in the file thumbdata4.
Why do files take up so much space
The main reason for the abnormal growth of files thumbdata lies in the peculiarities of the preloading algorithms. The system strives to create a thumbnail for absolutely any media file that comes into the scanner's field of view. This applies not only to photographs taken by the camera, but also to images downloaded from instant messengers, saved from the browser or received via Bluetooth.
In addition, there are software errors (bugs) in specific firmware from manufacturers like Samsung, Xiaomi or Huawei. In some cases, the rescan cycle becomes loopy: the system deletes old thumbnails and immediately creates new ones, constantly rewriting the database file. This leads to a situation where the file takes up 5, 10 or even 20 GB, although the actual volume of unique thumbnails does not exceed several hundred megabytes.
Another factor is the resolution of the source images. Modern smartphones take pictures with a resolution of 12, 48 and even 108 megapixels. Although the thumbnail itself is small, the metadata and service information in the database are scaled proportionally to the number of pixels processed when generating the preview. Warning: Do not attempt to edit the file contents manually using a HEX editor. Violation of the database structure will cause the gallery to stop displaying images at all until a complete reinstallation of media services is carried out. thumbdata are scaled in proportion to the number of pixels processed when generating previews.
โ ๏ธ Warning: Do not attempt to edit the contents of the file
thumbdatamanually using a HEX editor. Violation of the database structure will result in the gallery not displaying images at all until a complete reinstallation of media services is carried out.
Users often notice a spike in the size of these files after bulk importing photos from cloud storage or after restoring data from a backup. At this moment, Media Scanner is commanded to check thousands of new files at the same time, which creates a peak load on the caching subsystem.
Technical detail about compression
Inside thumbdata files, a specific compression algorithm is used, different from the standard JPEG or PNG. This is a binary format optimized for quickly reading sequential blocks of data, which explains why ordinary archivers cannot open these files.
Safe methods for clearing the thumbnail cache
Deleting files thumbdata is a completely safe operation for your personal data. It is important to learn the main rule: deleting these files does not delete your original photos and videos. The system will simply lose the thumbnail cache, and the next time you open the gallery, it will be forced to regenerate the thumbnails, which can take from a few seconds to several minutes depending on the number of photos.
There are several cleaning methods. The simplest is to use the built-in cleaning tools, if they support deep cleaning of the media provider cache. However, a more reliable method is manual removal through a file manager with access rights to system folders. To do this, you need to go to the directory DCIM, enable the display of hidden files (usually an option in the Explorer settings) and find the folder .thumbnails.
If you have a modern Android smartphone 11 and higher, where access to /sdcard/DCIM/.thumbnails may be limited or the folder may be missing (since the cache is moved deeper into the system), it is recommended to use a computer and connection by ADB. This is a universal method that works on any device with USB debugging enabled.
adb shell pm clear com.android.providers.media
adb shell rm -rf /sdcard/DCIM/.thumbnails/*
The first command in the example above clears the Media Storage app data by resetting the database, and the second one forces the deletion of thumbnail files in public storage. After completing these steps, it is recommended to restart the device so that the services are reinitialized correctly.
โ๏ธ Checklist before deleting thumbdata
Preventing file re-growth
After successful cleaning, a logical question arises: how to prevent the repeated accumulation of gigabytes of garbage? Unfortunately, it is impossible to completely disable thumbnail generation without losing gallery functionality, but you can minimize the amount of space taken up. One effective method is to create a dummy file.
The essence of the method is to deceive the file system. You create a file in the folder .thumbnails with the name thumbdata3--1967290299 (or relevant for your system), make it read-only and set the โRead Onlyโ attribute. When the system tries to write new data there, it will receive an access error and will not be able to increase the file size.
To implement this trick on devices with root access, you can use a terminal emulator or specialized applications like Root Explorer. The command in the terminal will look like this:
touch /sdcard/DCIM/.thumbnails/.nomedia
chmod 444 /sdcard/DCIM/.thumbnails/thumbdata*
It is also recommended to regularly clear the cache of social networking and instant messenger applications. They are often the source of thousands of small images that are actively cached by the system. Setting up automatic cache clearing in the developer menu or third-party optimizer utilities will help keep the volume of files thumbdata under control.
โ ๏ธ Warning: The read-only file method may cause the gallery to run slower on first launch after a reboot, since the system will not be able to update the cache. Use this method only if space is a critical issue.
Another strategy is to use cloud galleries such as Google Photoswith local storage of high-quality thumbnails disabled. Setting up synchronization parameters allows you to transfer the task of image processing to the company's servers, relieving the internal memory of the smartphone.
Creating a write-protected stub file is the most effective way to stop the uncontrolled growth of thumbdata, but it requires root access to set the necessary attributes.
The impact of cleaning on system performance
Many users fear that deleting system files will negatively affect the speed of the smartphone. In the case of thumbdata the opposite effect is observed, especially on devices with full memory. Freeing up a few gigabytes of space allows the system to use the page file and application cache more efficiently, which generally improves the responsiveness of the interface.
However, immediately after cleaning, you may notice a temporary slowdown in the gallery. This is normal behavior: the processor and drive will be busy regenerating the thumbnails. On older devices with slow flash memory, this process may cause the case to heat up. It is recommended not to open the gallery immediately after cleaning, but to let the device work in the background for 10-15 minutes.
If after deleting files thumbdata the gallery continues to work incorrectly (black screens instead of photos, application crashes), this may indicate damage to the media file index. In this case, you must force rescanning of the media. This can be done through the storage settings menu or by rebooting the phone in safe mode and back.
Experts note that regular (once a month) preventative cleaning of the thumbnail cache prolongs the life of the smartphoneโs storage. Constant writing and rewriting of large files thumbdata4 creates unnecessary load on memory cells eMMC or UFS, especially if the file grows to the limit.
Impact on the battery
The process of intensive thumbnail generation after clearing the cache can require up to 5-10% of the battery charge in one session. Plan cleaning while the phone is connected to the charger.
Is it possible to delete the .thumbnails folder completely?
Yes, you can delete the folder itself, but the system will automatically create it again the first time you try to open the gallery or take a new photo. It is more effective not to delete the folder, but to clear its contents or block writing to the files inside it.
Why does the thumbdata file appear again immediately after deletion?
This happens because the Media Scanner service works in the background and constantly monitors changes in the file system. As soon as it detects a missing cache or new images, it immediately begins the process of restoring the thumbnail database.
Will deleting thumbdata erase my photos?
No, absolutely not. Files thumbdata contain only small copies (previews) of your images. The original photos and videos are stored in separate files (JPG, PNG, MP4) and are in no way physically connected to the thumbnail database.
How to find the exact size of the thumbdata file without Root?
On modern versions of Android without root access, it is difficult to see the exact size of the system cache. However, you can estimate the amount used by the Media Storage application in Settings โ Applications โ Show system processes โ Media storage โ Memory.
Are there applications for automatically cleaning thumbdata?
There are utilities like SD Maid or Clean Master that can find these files. However, on Android 10+ their effectiveness is reduced due to file system access restrictions. They often require special permissions through the computer (ADB) to function fully.