Error related Out Of Memory issue


#1

Hi,
I received an error related Out Of Memory issue.
Please find my source below.

<GridLayout>
  <ListView [items]=" photosList"   class="small-spacing">
    <ng-template let-item="item">
      <StackLayout>
         
           <Image src="{{item.imageUrl}}" decodeWidth="400" decodeHeight="400" loadMode="async"></image>
                   
      </StackLayout>
    </ng-template>
  </ListView>
</GridLayout>

image
Appreciate you help to rectify above error

Thanks


#2
  • Are you trying to load images from remote server?
  • Are the images are high in resolution?

#3

Yes I am trying to load images from a remote server and images are high resolution.


#4

That explains why you are getting out of memory issue.
When you are loading images in a listView, it is better to load the thumbnail sized images.

When you want to show the image in fullscreen, you can use something like nativescript-imageswipe to show it.

Also I would recommend using nativescript-fresco for android and nativescript-imagecache for ios to display images.