Skip to content

ImagePicker VM Memory Issue #222

Closed
@NatanijelVasic

Description

@NatanijelVasic

Issue: Very big memory usage, leading to eventual crash when using the plugin often in one session.

Make sure to check the demo app(s) for sample usage

Testing on demo app and my own app.

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital
letter.

Which platform(s) does your issue occur on?

Both iOS and Android. Both on simulator and device.

Please, provide the following version numbers that your issue occurs with:

"nativescript": {
"id": "com.natanijel.flipside",
"tns-android": {
"version": "4.2.0"
},
"tns-ios": {
"version": "4.2.0"
}
},
"dependencies": {
"buffer": "^5.1.0",
"crypto-js": "^3.1.9-1",
"is-alphanumeric": "^1.0.0",
"nativescript-background-http": "^3.2.7",
"nativescript-bitmap-factory": "^1.7.1",
"nativescript-camera": "^4.0.2",
"nativescript-imagepicker": "^6.0.4",
"nativescript-onesignal": "^1.0.8",
"nativescript-photo-editor": "^1.0.3",
"nativescript-plugin-firebase": "^7.1.6",
"nativescript-theme-core": "~1.0.4",
"nativescript-ui-listview": "^3.5.7",
"tns-core-modules": "^4.2.1"
},
"devDependencies": {
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"lazy": "1.0.11",
"typescript": "^3.0.1"
},

Please, tell us how to recreate the issue in as much detail as possible.

For iOS: Monitor memory using Instruments.


First of all, great plugin! It's simple to use and effective. I'm just having an issue with my memory usage. My app's heap allocations are relatively small and under control, but I have problems with the "Anonymous VM" size over time, which can go into the gigabyte range when using the image-picker plugin often in one session (eventually leading to a crash).

When I load one HD image using the plugin, the Anonymous VM memory goes up by 250MB! I then run Simulate Memory Warning, but the allocation size barely goes down (see attached photo). A 4000x4000px 32bit colour bitmap isn't even 200MB, and my images are significantly smaller in dimension than that. Do you know why so much memory is being allocated without being released?

I have attached an image showing what happens when I load 1 photo (massive jump), followed by running "Simulate Memory Warning" (small dip). As shown in the table, CG Raster Data makes up almost all of the anonymous VM size. It is worth adding that when I load a new image from the plugin, sometimes a portion of the memory is released, but most times there is a growth.

Any help is greatly appreciated!

This memory usage is for the demo app:
screenshot 2018-10-29 at 12 35 05

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions