This is a demo of a potential memory leak in the LastPass browser extension for Chrome version 4.35.0 when navigating a Vue application that uses VueRouter and contains <form>
elements. The apparent cause is the retention of <form>
s in the FormDetection
formMap
.
The following instructions assume you have yarn, serve, and the LastPass browser extension installed.
- Clone this repository.
yarn install
yarn build
serve -s dist/
- Open Chrome.
- Navigate to http://localhost:5000/#/
- Open dev tools.
- Click on the Memory tab.
- Expand the drawer[1]
- Set the JavaScript context[2] to LastPass: Free Password Manager
- Create a live expression[3] for the
FormDetection
service's form map:window.LPModule.getService('FormDetection').formMap
- Click Go To Form.
- Press Submit.
- Observe the
formMap
contains 1 element and the memory usage is ~80MB. - Click Go To Form.
- Press Submit.
- Observe
formMap
contains 2 element and the memory usage is ~160MB. - Repeat as many times as desired.
- Observe that both the
formMap
contains one element for each visit to/form
. - Collect garbage and wait.
- Observe that the memory usage does not decrease by a meaningful amount.
- Navigate to
chrome://extensions
- Disable LastPass by clicking the toggle on its card.
- Navigate to http://localhost:5000/#/
- Open dev tools.
- Click on the Memory tab.
- Click Go To Form.
- Press Submit.
- Click Go To Form.
- Press Submit.
- Repeat as many times as desired.
- Collect garbage and wait.
- Observe that the memory usage drops to ~6MB.
[1] https://developers.google.com/web/tools/chrome-devtools/customize#drawer [2] https://developers.google.com/web/tools/chrome-devtools/console/reference#context [3] https://developers.google.com/web/tools/chrome-devtools/console/live-expressions