(totally not a click bait)
image src & read more at:
https://developers.google.com/web/fundamentals/performance/rail
what if your users spend hours, days, or even weeks without page reload?
*circular references aren't the case in Mark and Sweep algorithm,
but there are edge cases for JS + DOM
// window.performance.memory
{
totalJSHeapSize: 29400000,
usedJSHeapSize: 15200000,
jsHeapSizeLimit: 1530000000
}
you can even ask your clients to send you a snapshot and analyze it ❤️
przyklad, omowic retained vs shallow size
you can even ask your clients to send you their snapshots
Manually calculate memory allocated on heap but:
read more at:
https://w3c.github.io/longtasks
const observer = new PerformanceObserver((list) => {
const perfEntries = list.getEntries();
// queue reporting for long tasks existance
});
observer.observe({entryTypes: ["longtask"]});
// long task refers to occurrences of event loop tasks
// or pauses caused by UI thread work
// whose duration exceeds 50ms
fin