I'm currently working on a cool Android game which was about to be released real soon. Some of our beta testers started complaining that the game crashes with the “too many open files” error message. I've tried simulating this problem on the AVD emulator but couldn't reproduce the error.
Afterwards, I realized that only our Galaxy S3 and Asus Nexus 7 testers were complaining. I found this bug issue on Android's bug tracker and it sounds quite similar to what is happening to me.
This sounds like a serious architecture problem which effects all internal SD card devices. These devices are limited to only 1024 file descriptors! Can anybody confirm this problem?
Instances of the file descriptor class serve as an opaque handle to the underlying machine-specific structure representing an open file, an open socket, or another source or sink of bytes. The main practical use for a file descriptor is to create a FileInputStream or FileOutputStream to contain it.
On Android, media files are automatically saved in your WhatsApp/Media/folder.
What Is Media Storage on Android. Media Storage is a system process that is needed when you view, download, play, and stream images, videos, audio files, and other media files.
Actually it is not relevant whether this app is opening a lot of files or not. What's troubling is that the entire device is limited to 1024 open files. Take for instance a Galaxy S3 device running 100 apps each opening 10 files concurrently(properties, databases and the like). This is extremely close to the limit.
If you check the max open files limit (/proc/sys/fs/file-max) on most devices it is well over 50K.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With