Live data from Hacker News

Fuite: a tool for finding memory leaks in web apps

nolanlawson.com

11–20 of 34 posts

Re: Fuite: a tool for finding memory leaks in web apps

#11
This specific issue makes the "PHP way" (just to mention a notable example) of having an interpreter created to serve a page and then destroyed at the end, much more convenient, even if more resource intensive. Assuming the problem is not in the Javascript side of a single page application, of course.

Re: Fuite: a tool for finding memory leaks in web apps

#12

The only thing more tedious and brain-breaking than tracking down client-side JS memory leaks is tracking down server-side JS (Node) memory leaks.

Serious question, is it really more difficult fir server side JS? At least you don't have to fiddle around with DOM references. The potential impact on the server side is of course potentially bigger.

Re: Fuite: a tool for finding memory leaks in web apps

#13
Almost all SPAs do have memory leaks in my experience. I was once involved in Eclipse Memory Analyzer project(for Java, short MAT), and I mentored a student who built a prototype to support JS in MAT. We easily found significant memory leaks everywhere. That prototype was never released for reasons I cannot comment on in public.

Re: Fuite: a tool for finding memory leaks in web apps

#14
When I worked at Facebook, I worked on a web memory tracking tool I was particularly proud. It went through links, grabbed heap snapshots, diff'ed them, found objects that weren't cleaned up and gave detailed information about its retain chain. You can see a lighting talk I did on it at BlinkOn: https://www.youtube.com/watch?v=JuyaGFApifA&t=1427s&ab_chann...

We used it to find a problem fixed in React 18 that caused large leaks on Facebook.com: https://github.com/facebook/react/pull/21039#issuecomment-80...

We also found one issue that caused a leak that's impossible to spot unless you know how V8 closures are implemented and retain one another.

I'm really hoping to see Facebook open source the tool some day!

Fuite seems really interesting. I like the idea of an automatic crawler!

Re: Fuite: a tool for finding memory leaks in web apps

#17
post #12

The only thing more tedious and brain-breaking than tracking down client-side JS memory leaks is tracking down server-side JS (Node) memory leaks.

Serious question, is it really more difficult fir server side JS? At least you don't have to fiddle around with DOM references. The potential impact on the server side is of course potentially bigger.

I mean it depends on the application naturally, but flame graphs or no and especially when dealing with heap dump comparisons, sometimes very opaquely named symbols, etc, it can be an exercise in frustration.

Re: Fuite: a tool for finding memory leaks in web apps

#18
post #14

When I worked at Facebook, I worked on a web memory tracking tool I was particularly proud. It went through links, grabbed heap snapshots, diff'ed them, found objects that weren't cleaned up and gave detailed information about its retain chain. You can see a lighting talk I did on it at BlinkOn: https://www.youtube.com/watch?v=JuyaGFApifA&t=1427s&ab_chann... We used it to find a problem fixed in React 18 that caused…

Author here. I wasn't aware of your talk, but it's super interesting! Showing info about the retain chain is a great idea, but I didn't get around to doing it in fuite. IME just counting the number of objects is actually pretty effective to find the smoking gun. (You leaked 1 event listener, which leaked a bazillion strings, arrays, objects, etc., but all you really care about is the 1 event listener.)

I would love to see how your tool approaches this! Hope it gets open-sourced. :)

Re: Fuite: a tool for finding memory leaks in web apps

#20

How do crawler approaches like this handle SPAs that have a multi-step onboarding flow before getting into the actual heavy-hitting areas that need the most testing? (e.g. where you may have to click through several things before even hitting a route change)

Author here. I added support for custom scenarios, where you can define a "setup" step that logs in or does whatever you may need to do: https://github.com/nolanlawson/fuite/#extending-the-default-...
Post reply on HN