olofd / react-native-photos-framework

A modern and comprehensive CameraRoll/iCloud-library-API for React Native 📸 📹
MIT License
220 stars 99 forks source link

CreateAssets(): Got memory pressure notification (critical) #81

Open MobileAppVault opened 6 years ago

MobileAppVault commented 6 years ago

Hi,

I try to upload 400 Pictures to the camera roll and after 5 seconds i got the following errors and the app crashed:

RNPhotosFramework.createAssets({
                images : images,
                album : album, 
                includeMetadata : false
            }).then((res) => {
                console.log('done');
            }).catch((err) => {
                console.log(error);
            });
[812:43385] Error: Timeout waiting for response from assetsd in -[PHChangeRequestHelper _generateUUIDIfNecessary:]
[812:43385] [PhotoKit] Timeout waiting for response from assetsd in -[PHChangeRequestHelper _generateUUIDIfNecessary:] (retries 3)
[812:43001] Got memory pressure notification (critical)
Message from debugger: Terminated due to memory issue

The pics are very big and the first 5 pics are uploaded to the camera roll.

Is there anything i can do to avoid that or improve the memory?

Many thanks!

Kobzol commented 6 years ago

Have you tried uploading the pictures in batches? If you have 400 images, you can try uploading them in batches of 50 for example, maybe that could help with the memory pressure.