3 ms·
Speaking of memory leaks, I once had to debug a memory leak caused by console log entries. Objects that are logged to the console are prevented from being garba
by Felk 5y ago
Speaking of memory leaks, I once had to debug a memory leak caused by console log entries. Objects that are logged to the console are prevented from being garbage collected, even if the console was never opened. That includes DOM nodes or I think also handles to WebGL textures.
- franklyt 5y agoThat’s interesting. I’m guessing console.log appends to the window object somewhere, which is a fairly common method of image preloading.
- umaar 5y agoInteresting, I think that's because logged objects are "live", so you can inspect their current state, not just the state at the point of logging.