RawTexture.CreateLuminanceTexture update() function cause OOM( out of memory in chrome)

Hello everyone,

I use babylon 4.2 and may find a bug. When create a raw texture by calling
new BABYLON.RawTexture.CreateLuminanceTexture and update it by calling update() function, the memory of this raw texture will not be released and cause out of memory(OOM) finally.

It’s real strange, help!

Welcome aboard!

Could you provide a repro in the Playground? It will be easier for us to help. Thanks!

1 Like

here is the PG.
https://playground.babylonjs.com/#67ZXQY#42

I monitor chrome memory by windows system manager

Chrome version: 91.0.4472.124(64 bit)

In fact, this problem only occurs in few PC.

The PG does work for me.

Maybe your graphic card does not support the luminance format? You can try to use the red format instead (BABYLON.RawTexture.CreateRTexture).

My GPU is RTX 2080.
By the way, what’s the different between CreateRTexture and CreateLuminanceTexture?

CreateRTexture creates a red texture, meaning a texture with only the red component. I don’t know what a luminance texture is for, I have never seen it used…

Can you reproduce the problem with the 5.0 version?

Yes, this problem occurs in babylon 5.0.0 too.

Maybe someone with a RTX2080 can test and see if they reproduce the problem…

What do you see in the Memory tab of Chrome?
image

For me the memory used does not raise much, it stays between 50 and 100MB when browsing the PG.

it’s really a strange problem. We test in several rtx 2080, only two of them has OOM problem.

Have you checked you have the same drivers on all the PC?

Yes, all of them have the same GPU driver

Here is a topic about luminance texture What is a Luminance Texture and How to Create? - OpenGL: Basic Coding - Khronos Forums

I can not repro on the same chrome version with a RTX 2080 TI :frowning:

It mostly looks like an internal bug in the browser.

May I ask if you look into the cpu or gpu memory ??? cause your generateRandomArray would generate a lot of garbage quickly and I wonder if the cpu memory might be at cause here ?

We still not find the real reason…

We use an alternative approach in https://playground.babylonjs.com/#67ZXQY#49
only do once memory malloc allocation and change the data in the fixed memory.

In this time, it works.

1 Like