0

As I navigate through my NativeScript app, I keep running into out of memory crashes. I tried to resolve this by first upgrading {N} with @next for both tns-core-modules and tns-core-modules-widgets. I then installed nativescript-fresco and replaced all image tags with Fresco. It seems to of helped a bit but eventually if I navigate back and forth between a list view of images to another page, the app eventually crashes.

So I have a question regarding the usage of Fresco. Let's say I have a bunch of images that is 1600 x 1200 and 1MB each. And I use Fresco to display these images in a list view at thumbnail size like 100 x 100 square, does the app still load each of these images as a file size of 1MB each? Or does fresco create a thumbnail size and load a smaller file size version of the images?

I'm guessing that this maybe the reason why the app still crashes?

ZeroNine
  • 721
  • 1
  • 11
  • 29
  • Did you do a complete build after adding the plugin? Also you might want to make sure you uninstalled the existing .apk from any device/emulator if you had previously ran it to avoid conflicts with the old .apk not actually being the correct one you think it should be :) – Brad Martin Nov 14 '16 at 19:07
  • Hello Brad, yep, I did that.. still not sure why it crashes.. – ZeroNine Nov 14 '16 at 19:14
  • You might try removing the bindings when you navigate away, many different things to try really. – Brad Martin Nov 14 '16 at 19:18
  • I'm still a noob to Angular2 and {N} so I wouldn't be surprised if it's just bad code on my end. lol. Where can I find info about removing bindings on navigation? – ZeroNine Nov 14 '16 at 19:23
  • The API docs http://docs.nativescript.org/api-reference/globals and if you're setting a bindingContext, just null it out when navigating away. I forget all the events with angular 2 since you don't use the actual `Page` in your markup. I do mostly plain NS – Brad Martin Nov 14 '16 at 19:43

0 Answers0