react-native-blob-util
react-native-blob-util copied to clipboard
[iOS] Memory usage not being clean after successful upload
Hi, when uploading a large amount of files using ReactNativeBlobUtil.fetch(), the memory usage will climb steadily and it will not get cleared up after each successful upload, even after the entire upload process gets completed with some wait time thereafter. And there were no other activities while conducting the test. See screenshot, sample code below. Any suggested changes to flush the memory or this is an expected behavior?
Any input will highly appreciated. Thank you!
- Xcode profiler
https://drive.google.com/file/d/1_L8nzlYSR9YH_XWmVQzRXQ9zoG7LwW1x/view?usp=sharing
- Version used:
- "react-native-blob-util": "^0.16.2"
- "react-native": "0.68.2"
- Sample code snippet
const testUpload = async () => {
const fileBasePath = RNBlobUtil.fs.dirs.DocumentDir.replace(
/\/Documents$/,
'/tmp/react-native-image-crop-picker/',
);
console.log('fileBasePath', fileBasePath);
const imageFiles = await RNBlobUtil.fs.ls(fileBasePath);
for (let i = 0; i < imageFiles.length; i++) {
const filePath = fileBasePath + imageFiles[i];
try {
await RNBlobUtil.config({
fileCache: false,
}).fetch(
'PUT',
'https://<subdomain>.blob.core.windows.net/<params>',
{
'x-ms-version': '2020-02-10',
'x-ms-blob-type': 'BlockBlob',
'x-ms-meta-IsPublic': 'true',
},
RNBlobUtil.wrap(
Platform.OS === 'ios'
? filePath!.replace('file://', '')
: filePath!,
),
);
console.log('uploaded ' + i + ',' + filePath);
} catch (error) {
console.error('error on ' + i, error);
}
}
};
heyy @RonRadtke, any updates regarding this issue?
any update on this
any update issue still persist
I'm still experiencing this issue. Start out with 470MB, end up with 900MB memory taken.