Earlier quoted context omitted.
Interesting, my hunch would be something about the webgl buffers not getting freed, since they’re running in a tight loop. I’ll do some digging.
From a quick look it seems like you're doing gl.createBuffer() in a loop each time you're drawing, and never call gl.deleteBuffer(). It seems like WebGL will call deleteBuffer() automatically when the object is garbage collected by the JS runtime, but calling it explicitly when you're done with it will probably fix this particular issue. Also a suggestion, try to allocate your buffers only once on setup, and reuse th…
I built a vector map from scratch
31–40 of 43 posts
Re: I built a vector map from scratch
#32Whoa, zooming and panning too fast crashed the entirety of Firefox. All windows just gone in an instant. How is that even possible nowadays?
Re: I built a vector map from scratch
#33Re: I built a vector map from scratch
#34Earlier quoted context omitted.
Interesting, my hunch would be something about the webgl buffers not getting freed, since they’re running in a tight loop. I’ll do some digging.
From a quick look it seems like you're doing gl.createBuffer() in a loop each time you're drawing, and never call gl.deleteBuffer(). It seems like WebGL will call deleteBuffer() automatically when the object is garbage collected by the JS runtime, but calling it explicitly when you're done with it will probably fix this particular issue. Also a suggestion, try to allocate your buffers only once on setup, and reuse th…
Re: I built a vector map from scratch
#35This tutorial is absolutely fantastic.
Re: I built a vector map from scratch
#36This reliably and repeatedly locks up and crashes my mobile embedded browser and its parent app, my HN reader (Materialistic). I've never seen a more aggressively crashing site in all my years... took me 6 tries to post this comment, only once I bypassed the linked article/site.
Re: I built a vector map from scratch
#37Re: I built a vector map from scratch
#38The demo map crashed my iPhone in the weirdest way. After zooming in and out a bit, the screen went dark, then fully pink , then it restarted.
Re: I built a vector map from scratch
#39The demo map crashed my iPhone in the weirdest way. After zooming in and out a bit, the screen went dark, then fully pink , then it restarted.
Yep, my phone too. I'm on a pixel 6.
edit: But I like your blog post, now that I opened it on my Mac.
Re: I built a vector map from scratch
#40Earlier quoted context omitted.
From a quick look it seems like you're doing gl.createBuffer() in a loop each time you're drawing, and never call gl.deleteBuffer(). It seems like WebGL will call deleteBuffer() automatically when the object is garbage collected by the JS runtime, but calling it explicitly when you're done with it will probably fix this particular issue. Also a suggestion, try to allocate your buffers only once on setup, and reuse th…
I moved the createBuffer call out of the render loop, and I think the memory issues on FF should be working better (at least on FF 103).