react-native-blob-util icon indicating copy to clipboard operation
react-native-blob-util copied to clipboard

Android: Too many receiver, Total of 1000, registered for pid

Open Vasudevan-iOS opened this issue 2 years ago • 5 comments

Hi,

The Android app getting crash, When I download more than 1000 image, but iOS works fine.

Screenshot 2023-02-14 at 4 28 07 PM

Version of installed library and RN :

Screenshot 2023-02-28 at 12 13 28 AM

Code Snippet:

Screenshot 2023-02-28 at 12 10 19 AM

Can someone please suggest what I made mistakes

Vasudevan-iOS avatar Feb 27 '23 18:02 Vasudevan-iOS

@RonRadtke any suggestions for this issue ..?

Vasudevan-iOS avatar Mar 01 '23 05:03 Vasudevan-iOS

Looks like we are limited on the amount of receivers per pid. The Request class I'm using internally extends BroadcastReceiver. Every download will create a new one. So you somewhen will run in the limit there. Does it help to wait till the requests are done before starting new downloads?

But unless we find a problem that the receivers are not cleaned up and this is causing the issue we won't be able to do much here.

RonRadtke avatar Mar 02 '23 21:03 RonRadtke

@RonRadtke We are waiting till the previous execution gets over. We suspect the framework is not releasing the threads internally and that's how it is hitting the ceiling. Is there a way for us to call a function explicitly to clean up the threads used internally? Please guide us as we need to download more than 1000 files one by one.

Vasudevan-iOS avatar Mar 03 '23 06:03 Vasudevan-iOS

No there isn't. I think there is more likely a problem that the receivers are not correctly destroyed/ unregistered.So that basically the request objects don't die after being finished and reported to the javascript side.Sent from Outlook for Android

RonRadtke avatar Mar 03 '23 06:03 RonRadtke

https://github.com/RonRadtke/react-native-blob-util/issues/226 I put it on my todo

RonRadtke avatar Mar 03 '23 12:03 RonRadtke

Should be fixed with the new event system

RonRadtke avatar May 04 '24 07:05 RonRadtke