Oculus Quest 2 hangs and crashes the app while Loading 8000*8000 images

This is the Code Which gets the Images from the Folder and then add to an Texture2D List named render .
While Loading the Images the app crashes and stops responding.
This code works Perfectly in Unity Editor/Desktop but the app is crashes in the VR App in Oculus Quest 2

var dir = new DirectoryInfo(Path.Combine(Application.persistentDataPath, "Projects", "TEST", "Images"));
        var files = dir.GetFiles();
        for (int i = 0; i < files.Length; i++)
        {
            byte[] bytes = File.ReadAllBytes(files[i].ToString());
            Texture2D loadTexture = new Texture2D(1, 1); //mock size 1x1
            loadTexture.LoadImage(bytes);
            renders.Add(loadTexture);
        }

how many images you have there?

maybe runs out of memory or fails to load from that path,
whats the error in device log/logcat?

5 Images are There in the Path

Logcat error is Memory exception failure

test with smaller or fewer images to confirm,
its mobile device so probably cannot handle those…

It works with smaller images.
Its look like memory issue. but can not find workaround to fix this. I can not reduce image size(8192x8192) as I required it to show good quality images in VR.
I am trying to use Streaming asset but as my images are getting loaded from server then how can I replace that in apk’s streaming asset folder.
For asset bundle I read that we can not generate asset bundle in runtime. As I have another app to upload images to server.

does it need multiple large images visible at the same time? (or 1 at a time)
is the whole image visible, or you are zoomed in or viewing only part of the image? (like 360 image or something)

some kind of virtual texturing could work, if you need to zoom info images *if its supported in quest

Amplify Creations » Amplify Texture 2 *not sure if this plugin is still alive

Here’s an app flow:

  1. Having one admin app (Desktop) to upload images to the server folder wise.
  2. Having another app (quest 2) to view 360 images from server using a texture mapped on sphere. I need to iterate through images using thumbstick one by one. This functionality works smooth if I build with 8k images pre loaded in build. But starts crashing when I try to load dynamically.

I think sparseTexture would work if there is a problem in pre loaded version too, but it works fine.
amlify-texture seems dead.

This looks crazy as I am using www.dispose() too to clear memory after every image load…!

coud check with memory profiler that was is eating the emory (if it allows connecting to quest)
https://docs.unity3d.com/Packages/com.unity.memoryprofiler@1.1/manual/index.html

i guess other option to try could be downloading files into device,
then load single image on demand from there (since only 1 is visible).