AlbertTJames Posted March 3, 2017 Share Posted March 3, 2017 Hey everyone, I have a very simple 2D "minigame" that looks like this (please don't mind the uglyness) : So very simple, only one sprite and a couple of shapes. But my computer (macbook pro) often starts heating up while running the task. So I ran a memory audit (around 700ko increase per minute, that are due to me storing a lot of stuff) and also ran a CPU profile with devtools. Here are the results of the CPU profile: I was wondering if those results seemed ok to you ? @Nockawa Or do you think I might be doing something wrong in the code? (too large to share) When I look at the engine.fps I am at around 60fps, so perfect on that side. The game will be used by around 300 people all over the US with all sort of computers, mine is a high end macbook pro of last year (with of course a shity gpu but still pretty common for macs): 2.2Ghz i7 - 16Gb ddr3 - Intel iris pro 1536 mb - Mac/OS sierra using Chrome Canari Thanks ! Quote Link to comment Share on other sites More sharing options...
Nockawa Posted March 3, 2017 Share Posted March 3, 2017 Hello, First call this on your canvas: canvas.createCanvasProfileInfoCanvas(); and put screenshot of the window's content when you rendering is the slowest. thanks Quote Link to comment Share on other sites More sharing options...
AlbertTJames Posted March 3, 2017 Author Share Posted March 3, 2017 Looks ok no ? Quote Link to comment Share on other sites More sharing options...
Nockawa Posted March 3, 2017 Share Posted March 3, 2017 Well, I'm not really concerned, the number are really low, now if you don't do anything special in 3D it's understandable that most of the time is in C2D. I've just noticed that I don't display the render time in ms in the Canvas Profile, I'm going to add it. MasterK did waaaaaaaay much more complicated in his game, so I'm pretty confident, but be assured, I wouldn't let a perf issue aside. Perf is top priority. Let's keep this thread for a while, I'm about to release a new version I'm going to add the counter and also profile it thoroughly before releasing it, I'll keep you in touch. I've created this Trello Card for me to remind about it. Take a look at MasterK's game here: https://apps.facebook.com/locotitans/ all the UI is made with Canvas2D you'll see there's plenty of it. MasterK and AlbertTJames 2 Quote Link to comment Share on other sites More sharing options...
fenomas Posted March 3, 2017 Share Posted March 3, 2017 That chrome profile is showing that the CPU is almost entirely idle. I wouldn't worry too much about the mac book heating up - in my experience they heat up pretty much any time the GPU is running, even for trivial amounts of work. Just how they're made, I think - partly caused by the fact that Apple doesn't like fan noises, so the fans stay off until the machine gets really hot. AlbertTJames 1 Quote Link to comment Share on other sites More sharing options...
MasterK Posted March 4, 2017 Share Posted March 4, 2017 I dont worry about c2d's frame time. it's stable and acceptable. I'm worry about the memory leak... In our game, play core battle scene 6-8 times will rise memory to 1G.... And I think BJS dont make good manager with mesh/geom/vertice/buff or other these things. when i dispose all meshes, textures, materials...(almost like scene.dispose) some BJS object hasn't clean memory. @Deltakosh Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 4, 2017 Share Posted March 4, 2017 You have to pay attention to all reference to your meshes, otherwise it won't be taken into account by the garbage collector. It's not related to bjs in any way. I use bjs in several professional apps, and the only problem I had with the memory management was related to my work on storing meshes and materials. Quote Link to comment Share on other sites More sharing options...
MasterK Posted March 4, 2017 Share Posted March 4, 2017 @Temechon well, that's useful information. I'll deep look at our code. Quote Link to comment Share on other sites More sharing options...
fenomas Posted March 4, 2017 Share Posted March 4, 2017 As a second data point, I'm working on a big project with lots of dynamic meshes getting created and disposed, and I've profiled for memory leaks and not found any so far. MasterK 1 Quote Link to comment Share on other sites More sharing options...
AlbertTJames Posted March 4, 2017 Author Share Posted March 4, 2017 Thank you for your comments, indeed on Master K game my mac is also heating up, but no performance problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.