facebook/memlab

Documentation on where to take the "final" heap snapshot

slto opened this issue · 1 comments

In the "How memlab works" document (https://github.com/facebook/memlab/blob/main/website/docs/how-memlab-works.md), it says:
"Finally, come back to the baseline page (BP), and take the last heap snapshot SBP'. With these heap snapshots, memlab finds memory leaks as explained in the next section. (the final page is specified by the back callback in [test scenario]"

Is it really necessary to come back to the baseline page? The requirement should only be to navigate to another page (which could be the same as the baseline page), where the objects allocated when visiting the target page are not expected to be live anymore. Is my understanding correct?

For example, if I have a 3 step checkout flow:
(1) Enter address page -> (2) Enter payment page -> (3) final order confirmation page
I want to debug mem leak after rendering page (2). But there is no button to go back to page (1). I should be able to just go to page (3) and take the final snapshot, and memlab would be able to identify leaks from page 2 the same way as if I were able to navigate back to page (1) and take the final snapshot?

It is not a big issue but if my understanding is correct, then the documentation seems more restrictive than it needs to be. It would be good to consider updating the doc so a memlab user would not be concerned about using it for cases where there is no navigation path to return to the baseline page.

@slto You're correct; there's no need to return to the baseline page specifically. Simply navigating to a different page or triggering any interaction that allows the web app to release the memory that is supposed to be released on the target page will be fine. The documentation is somewhat out of date.