Kilombo

Memory consumption difference between 1.11 and 1.12-beta

Recommended Posts

Good evening everyone,

 

Did anyone noticed the exagerated memory consumption on the new last 1.12-beta version? It costs double the memory that 1.11 version consumes. Check the screenshoot.

 

What does this new version brings that consumes this enormous amout of memory. It's to much for mobile devices for sure.

Anyone else getted this problem?

 

On the right side you have firefox running one instance of the game and it's consumming 666Mb of memory, that instance is running 1.12-beta. On the left side you have chrome running with a different user and is consuming less then a half of firefox (233Mb), chrome is running 1.11.

post-8187-0-89552600-1401757513_thumb.pn

Share this post


Link to post
Share on other sites

I did a first test. Using Heart scene (http://www.babylonjs.com/?HEART)

 

Here is the memory usage using F12 tool:

 

bjs 1.11

1.11.jpg

bjs 1.12 beta:

1.12.jpg

 

As you can see there is almost no difference (the 1.12 is even better).

 

So there may be an issue with a specific feature you are using. We must find out which one

Share this post


Link to post
Share on other sites

Hmmmm... Agree, I just made a new test with spaceship. And has you can see. Firefox does consume more memory (114Mb versus 81Mb), altough, 1.12 version is running on chrome and firefox is running 1.11. And the kind of difference that happened in my scene is not happening in this one.

 

post-8187-0-58868900-1401760142_thumb.pn

Share this post


Link to post
Share on other sites

Also, you should use the same browser if you want to compare.

Test each browser with both versions then compare.

The problem is that my scene has a database connection with users validation, so I need a new session for each user, and the only way that I found to test the communications in the same computer with different users was this way.

Share this post


Link to post
Share on other sites

Maybe you can use incognito or test them one after one.

Anyway, it seems like FireFox consumes more than Chrome on your computer.

 

In my case, I didn't look at memory consumption and I only use 1.11 for now, but Chrome is usually slower than FireFox in my scenes.

Share this post


Link to post
Share on other sites

Delta, you can check for your self.

http://andromedaquest.tk/map.php - here is version 1.12-beta (consuming 650Mb +/-)

http://andromedaquest.tk/map2.php - here is version 1.11 (consuming 150Mb +/-)

 

I tested both in Chrome. My first impression is that it must be related with this lines:

camera.renderWidth = 4000;
camera.renderHeight = 4000;
camera.maxZ = 25000;
or with : var chaoTeste = BABYLON.Mesh.CreateGround("chaoteste", 15000, 15000, 1, scene, false);
 
Maybe the versions treat the cameras and the ground mesh differently, and some how in version 1.12 it is drawing everything in the first place, and in 1.11 is not (just a suposition).

Share this post


Link to post
Share on other sites
I see that too. Firefox consumes a lot more (double) compared to Chrome.

This is so that I now use Chrome as Firefox with WebGL is not great.

So the problem is not the engine but Firfox. I'm using version 1.12 and I find it faster on my stage compared to previous version.

By against version 1.12 fixes many bug that change the behavior of some thing on our stage and we used to find it normal but was not.

Share this post


Link to post
Share on other sites

Thanks dad72, but that's not the real problem. I do have different results in the same browser (has you can check in my printscreens). I'm still trying to find out what is causing this. The difference is big between the two versions (1.11 and 1.12), altough is relationed with my project (or some feature that I'm using on it).

Share this post


Link to post
Share on other sites

Hum I think I know where the problem is!

 

CreateGround now returns a GroundMesh which has some integrated features like automatic octree. The octree could be the problem here.

 

Could you check with the newer version I've just pushed to github?

Share this post


Link to post
Share on other sites

Hum I think I know where the problem is!

 

CreateGround now returns a GroundMesh which has some integrated features like automatic octree. The octree could be the problem here.

 

Could you check with the newer version I've just pushed to github?

Delta.... Unfortunately... It didn't work out :(

Still a lot of memory in use. Check the printscreen. I'm going to start disabling features (one by one) to get the problem.

post-8187-0-57729000-1401827863_thumb.pn

Share this post


Link to post
Share on other sites

Delta.

 

The problem is on the skybox. I commented out this:

/*var skybox = BABYLON.Mesh.CreateBox("skyBox", 15000.0, scene);
        var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
        skyboxMaterial.backFaceCulling = false;
        skybox.material = skyboxMaterial;
        skybox.infiniteDistance = true;
        skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
        skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
        skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("Textures/Skyboxes/1_1/space", scene);
        skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
*/
And the memory consumption droped from 630Mb to 96Mb.
post-8187-0-88844000-1401828167_thumb.pn

Share this post


Link to post
Share on other sites

Delta, I found out that in IE it works just fine. Interesting thing. I can't explain it. The best memory performance (consumption) is on IE.

The diference is huge.

Try it yourself Delta go to my website and use the testing user (I'll keep it working for 1 or 2 days) username: experiencia2 password: xpto

url: http://www.andromedaquest.tk

 

post-8187-0-92904900-1401832636_thumb.pn

Share this post


Link to post
Share on other sites

Why you do not use this for your sky. This allows to have a smaller size sky that always keeps the distance wish per report has your camera.

skybox.infiniteDistance = true;

;)

Share this post


Link to post
Share on other sites

Why you do not use this for your sky. This allows to have a smaller size sky that always keeps the distance wish per report has your camera.

skybox.infiniteDistance = true;

;)

Well. The problem is that, things that are positioned in cordinates outside of the skybox do not appear in the camera view, by that, it's the same thing has if they weren't on the scene. :(

Share this post


Link to post
Share on other sites

I created a bigger skybox and still no problem:

http://www.babylonjs.com/playground/##2A6EL9

Hi Delta,

 

I think the problem is relationed with my texture. I tried with your textures and it worked just fine (consumed 132Mb of memory, a reasonable amout). Your textures are 512x512 mine are 2048x2048 (much bigger resolution and size). What's bothering me is that I don't understand why does this problem only appears on 1.12 version and not in 1.11.

I'll stick with 512x512 resolution. Altough for the size of my skybox, we have to admit that it gets quite pixelized (it's a crappy resolution), but it will work for now.

 

So... The problem is relationed to the textures. I tried to look at code to start figuring it out, but it's too many texture classes, and some extends others, I still don't have enough knowledge on the framework to be helpfull on this. Sorry Delta :(

Share this post


Link to post
Share on other sites

2048 * 2048 It is huge and has ban for use on browser. 512 * 512 and what is the most use in texture in the same professional games, see 1024 * 1024 maximum for HD, but more, it's too heavy.

 

try with 1024 * 1024 or 768 * 768

Share this post


Link to post
Share on other sites

2048 * 2048 It is huge and has ban for use on browser. 512 * 512 and what is the most use in texture in the same professional games, see 1024 * 1024 maximum for HD, but more, it's too heavy.

 

try with 1024 * 1024 or 768 * 768

You are right mate!. Indeed.... 2048*2048 is to big. Altough, there wasn't a problem when running on 1.11 and now we have a problem running on 1.12. And that's the point. We have to find out what's happening. I'll change my res to 1024*1024.

 

Thanks anyway dad72.

Share this post


Link to post
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.

Guest
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.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.