Jump to content

BJS 2.x take a lot of ram when load texture


Recommended Posts

First, by RAM or memory I assume you are talking about CPU's not GPU, but tell me if I am wrong.  Checking engine.createTexture creates textures 2 different ways:

  • TGA & DDS using Tools.LoadFile
  • Everything else using Tools.LoadImage

I diff'ed the current version of LoadImage with a really old (no 1.4 tag found), and they both rely on CreateObjectURL.  Can see no real change to account.  Am wondering though, is this even needed on CPU?  Might using TGA or DDS avoid this.  Here is diff (might be a little wide)


Link to comment
Share on other sites

Apparently I have the same issue : loading textures leads to an increase of the memory footprint of the browser, and the allocated memory remains there for quite some time (a few seconds) before being released, even if the texture has successfully been loaded. I was expecting that the RAM allocated on the CPU would be released immediately after texture loading.

Apparently the behaviour depends on the browser used : the memory increase (relatively to the whole memory used) in not noticeable when using Edge, slightly noticeable with IE and Chrome, and extremely noticeable with Firefox.

Link to comment
Share on other sites

we know this depend for texture

let we calculate we know gpu use uncompress pic so

i have 200 pic 1024x1024 px RGBA  = 200*1024*1024*4  =  838'860'800 bytes = 838 mb

i have less than 1024x1024 size but have 230 pix in melyon.ir when i use old version i have 500mb ~ 800mb when load

with new version i watch i have 3G ~ 5G(some low graphic card) so what is that data :unsure: i owerride 2.5 loadtexture with old version but nothing fixed

i rewrite setTexture with standard Webgl setTextureUniform and shader , problem solved so what we have in new version  that can be danger for next v

 you can't see that with small project and small textures

test that with more than 200 mesh and larger than 512x512 you see double ram is taked some times more

what happen when we want render in vr?

when ram is overflow your loading take long time  "something wrong we need find that "



Link to comment
Share on other sites

48 minutes ago, Nabroski said:

I just copied sametexure 6000px on 80 spheres and in looks so increadebel awesome

i have to share i somewhere

my playground runs at 200mb




shortvideo 3sec, i dont know you to insert it directly into the post :)


one 6000 px on 80 sphere 

you most test 80 different pix

use  this

for(int i = 0;i<80;i++) mat.setTexture(new .. ( "/textures/m.jpg?rd"+i ) .. );

Link to comment
Share on other sites

36 minutes ago, Nabroski said:


I tested much more then this



that sample have 4 hdr pic that take more than 1 Gbyte  Ram ( see taskmanager Not browser )







4 pix 6000x2900 = 278400000 byte = 278 mb  

used ram : 4.6G(after) - 3.2G( befor) 1.4 G

this step important in loading not after that 


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...