Keep a fixed limit on the number of simultaneously open files. Due to the design of the libcore file system, we don't know when a user has finished reading a file, so we'll keep track of recently accessed files and forcibly close old native handles when too many have accumulated.
libcore|NativeFile: Improving file handle management
Keep a fixed limit on the number of simultaneously open files. Due to the design of the libcore file system, we don't know when a user has finished reading a file, so we'll keep track of recently accessed files and forcibly close old native handles when too many have accumulated.