I have an app that makes many asynchronous calls to external APIs to fetch details about an image thumbnail to load into my RecyclerView(using Glide) as a user scrolls through it. The Recyclerview is "never-ending" as there can be thousands of images to load if the user wanted to scroll long enough.
I am getting the following error after scrolling through maybe a hundred images:
W/Adreno-GSL: <gsl_ldd_control:541>:ioctl fd 55 code 0xc0200933 (IOCTL_KGSL_TIMESTAMP_EVENT) failed: errno 24 Too many open files
<ioctl_kgsl_syncobj_create:3977>: (38, 1f, 3907) fail 24 Too many open files
E/Parcel: fcntl(F_DUPFD_CLOEXEC) failed in Parcel::read, i is 0, fds[i] is -1, fd_count is 1, error: Too many open files
I/Adreno: DequeueBuffer: dequeueBuffer failed
E/NativeCrypto: AppData::create pipe(2) failed: Too many open files
The app never crashes but it remains frozen until I (wait a bit? and then) tab out of the app and back in to it.
From the research I've done I've learned that there's a limit on how many files can be open at once but I'm not sure how to control this.
- How do I know how many files are currently open?
- How do I "pause" my RecyclerView as it waits for more files to free up?
- Am I supposed to be doing something in my AsyncTask to free up the file(s)?