[Solved]Fixing OOM Error

Intro

Hey guys, I am facing OOM error (Out Of Memory). I want to load images from a folder in grid view. So first my logic just load a few images with oom error than I used AsynProc extension which improved the results but still after around 38 images it gets oom error

Note:

I am switching Screens properly as mentioned by Mika in his guide

Blocks

main


Blocks Explained

  • The first image contains a procedure called “Image” get File List in a directory and then the separate file name.

  • The second Image contains a procedure called “imga” which create dynamic images in vertical arrangement 2 and set the image which is at even places in the list

  • The third Image contains a procedure called “imga1” which create dynamic images in vertical arrangement 1 and set the image which is at odd places in the list


So guys help me in improving my procedure or any alternate to get out of this problem.

Thanks for your Support


The Solution

Thanks @sonumohammad333 for your “clock” tip
and Thanks @Kanishka_Developer for re-defining the process

Here is what Kanishka did

blocks



blocks (3)

1 Like

It’s normal that you get an outofmemory error if you try to load full size images in that amount . You will have to reduce the image size.

so you suggesting me to reduce dynamic image height and width?

No, this wouldn’t reduce the file size as JPEG is a compressed file format. And a jpg picture with eg. 500kb may use a lot more memory when decompressed and showing. No matter how you reduce the frame where it’s shown, because the file size stays. You will have to reduce the pictures themself for example with an image editor

hm, so any way out?

This error occurs when RAM is insuffucient
See if you are looping any procedures
Or Making a big calculation
These may cause OutOfMemory error

You are using for each number block
If length of file list variable is a big number it can cause this error

yes the no. of images may even cross 1000 but i tested with 515 and still error, that is why i was searching for a better idea

Still 515 is a big number… for the block
Use clock instead to do it one by one
Set time interval suitable to your process

Why are you loading hundreds of images at a time
Load images as user scrolls content
Use scroll arrangement handler extension from Colintree
https://aix.colintree.cn/en/extensions/ScrollArrangementHandlers.html

When user gets to the end load new images…

i was thinking about it , i even suggested today to a user, thanks for your suggestion just giving it a try!, thanks for linking extension :smiley:

Then please Mark As Solution

i know, let me try :slightly_smiling_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.