Friday, 25 May 2018

AppData::create pipe(2) failed: Too many open files, java.io.IOException: open failed: EMFILE (Too many open files)

AppData::create pipe(2) failed: Too many open files
java.io.IOException: open failed: EMFILE (Too many open files)

solution:

if you are seeing above errors, then you need to check if you are using okhttp, if yes, then, make all your call to share the same client instance. make a globel instance.

And close reponse if you are using reponse.body()

then you may get above issues when you are using a lot of AsyncTask.

you need to create Executor and limit the threadpool size.   then execute your task by:

new YouTask().executeOnExecutor(youexecutor)



No comments:

Post a comment