這 APP 之前 Code 不知道怎寫的 (ninja-code * god class),在下載檔案時會有超級爆幹頻繁的網路活動,當到了一定數量後就爆炸了。
分析
首先看一下崩潰時的 Log, 在 try-catch 中接到 IOException 印出 okHttpClient IOException 前, 可以看到 AppData::create pipe(2) failed: Too many open files
1 2 3 4 5 6 7 8
2023-02-15 11:29:23.511 BufferQueueProducer E [com.package.name.debug/com.package.name.MainActivity] queueBuffer: fence is NULL 2023-02-15 11:29:23.512 Surface E queueBuffer: error queuing buffer to SurfaceTexture, -22 --------- beginning of crash 2023-02-15 11:29:23.512 OpenGLRenderer A Encountered EGL error 12299 EGL_BAD_NATIVE_WINDOW during rendering 2023-02-15 11:29:23.512 libc A Fatal signal 6 (SIGABRT), code -6 in tid 3225 (RenderThread) 2023-02-15 11:29:23.553 NativeCrypto E AppData::create pipe(2) failed: Too many open files 2023-02-15 11:29:23.554 SomeService E okHttpClient IOException 2023-02-15 11:29:23.554 System.err W javax.net.ssl.SSLException: Unable to create application data