Comments (9)
I did run into an issue with it too though, crashing my entire system with itself.
Can confirm :( My system ran out of ram after couple of minutes with the tab opened.
from good-web-game.
Still no idea whats going on, but at least I found a way to profile it without crashing my system :)
With the super narrow window it stop rendering and memory stops leaking for some reason.
from good-web-game.
Just noticed a lot of errors in the console:
Error: WebGL warning: texImage2D: Requested size at this level is unsupported. game.js:643:388
Error: WebGL warning: clear: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0Attachment has no width or height. game.js:703:92
Error: WebGL warning: clear: Framebuffer must be complete. game.js:703:92
Error: WebGL warning: drawArrays: Framebuffer not complete. (status: 0x8cd6) COLOR_ATTACHMENT0Attachment has no width or height
...
Error: WebGL: No further warnings will be reported for this WebGL context. (already reported 32 warnings)
from good-web-game.
@not-fl3 thanks for this! What version of Firefox are you running? I don't see any errors in the console here, I guess iOS safari might suffer from the same issues around FBOs.
from good-web-game.
Oh, my bad, the errors was the result of insufficent window size :(
Also an issue I suppose, but not the one we are looking for.
from good-web-game.
Ah, that makes sense. Non the less, the memory leak sounds like something that should be possible to track.
from good-web-game.
Mostly just guessing here, but it looks to me like video ram is leaking, when I look at processes nothing is happening, but the actual memory usage shows a pretty standard GC saw pattern - things go up and down by 2 GB every few seconds in the system monitor:
Zemeroth is showing a completely flat line, so I'm 80% sure that framebuffers (or rather how I'm using them to emulate the Canvas api from ggez) are the culprit here given the rate of bloat.
Edit: same is happening on Chrome, I guess Chrome GC might actually clear all memory vs Firefox cleaning most but not all of it, leading to a crash after couple minutes.
from good-web-game.
DUH!
This is actually related to #14. I have to recreate my main Canvas
when the screen is resized, but for some reason I figured it would be a good idea to do it as a part of draw
instead of resize_event
, and to do that I've also employed a dirty flag to inform the draw
loop when it needs to create a Canvas
with a new size. I hate dirty flags but sometimes they are useful. Anyway, everything works fine, except..:
if self.canvas_dirty {
graphics::clear(ctx, [0.0, 0.0, 0.0, 0.0].into());
self.canvas = Self::create_canvas(ctx, self.canvas_size)?;
}
I never actually set the flag back to false
🤦♂️. Since creating a new Canvas
creates a new Texture
, and Texture
is a leaky abstraction (in both meanings of the word, as per #14) this creates the leak on every frame.
Edit: deployed new .wasm with a fix :P.
from good-web-game.
Glad you figured it out!
New version works fine in firefox :)
from good-web-game.
Related Issues (20)
- How to log message in wasm? HOT 2
- shaders HOT 1
- filesystem
- screenshot
- wasm-bindgen HOT 8
- blend modes behave differently than in ggez
- Canvases and multisampling HOT 3
- `TypeError: wasm_exports.crate_version is not a function` HOT 1
- Memory deallocation bug in `Drawable`s HOT 2
- WASM support for RNG HOT 3
- incompatible gl.js version HOT 2
- WASM failed to load, probably incompatible gl.js version HOT 3
- to_rgba8 support HOT 2
- Versioning issues while compiling for android HOT 2
- unresolved imports `quad_snd::decoder`, `quad_snd::mixer::Sound`, `quad_snd::mixer::SoundMixer` HOT 1
- "No such file or directory" when building for Android HOT 4
- shadows example
- WASM runtime errors HOT 2
- good_web_game::graphics::draw not working correctly on Windows HOT 5
- JS file doesnt work *WASM failed to load, probably incompatible gl.js version* HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from good-web-game.