This repository was archived by the owner on Jun 16, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
This repository was archived by the owner on Jun 16, 2023. It is now read-only.
fixOrientation memory #3001
Copy link
Copy link
Closed
Labels
staleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Bug Report
To Do First
- [yes] Did you try latest release?
- [no] Did you try master?
- [yes] Did you look for existing matching issues?
Platforms
Android
Versions
- Android: 10
- iOS:
- react-native-camera: 3.40.0
- react-native: 0.61.5
- react: 16.9.0
- react-navigation: 5.12.3 (happens also in a clean project without any navigation)
Description/Current Behaviour
Expected Behaviour
When taking a picture with fixOrientation, memory is going up 100MB approximately and won't cleanup even after I navigate to another screen. Just after 5-10 minutes the garbage collector cleanup the memory.
Steps to Reproduce
Set fixOrientation to true in android device
Additionals
Code example: new project without navigation, just 1 screen.
class App extends React.Component {
private _cameraRef;
private _handleRef = ref => {
this._cameraRef = ref;
};
private _takePicture = async () => {
const image = await this._cameraRef.takePictureAsync({
quality: this.CAMERA_QUALITY,
fixOrientation: true,
width: this.CAMERA_WIDTH,
pauseAfterCapture: false,
orientation: 'portrait',
});
RNFS.unlink(image.uri).catch(() => {});
};
render() {
return (
<View>
<RNCamera
style={{height: '100%', width: '100%'}}
ref={this._handleRef}>
<TouchableOpacity onPress={this._takePicture}>
<Text>press here!</Text>
</TouchableOpacity>
</RNCamera>
</View>
);
}
}
memory after taking a picture:

memory after taking 4 pictures: If I take some more, the memory is still on 180MB

maggialejandro-rp
Metadata
Metadata
Assignees
Labels
staleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.