This repo provides a minimal demonstration of office-js issue #1054. It has been created using the Microsoft Yeoman office-js generator.
- Open a command prompt as administrator.
CheckNetIsolation LoopbackExempt -a -n="microsoft.win32webviewhost_cw5n1h2txyewy"
- Open a command prompt as your user.
git clone https://github.com/day8/office-js-memory-leak
cd office-js-memory-leak
npm install
npm start
- Excel should open automatically.
- Select the 'Insert' tab in the Excel ribbon
- Click 'My Add-ins down arrow' (the down arrow menu on the right, NOT the button on the left)
- Under 'Developer Add-ins' click 'Content Add-in Memory Leak'
- If you get the error "We can't open this add-in from localhost" quit Excel, run
npm stop
and go to 7. - If the Content Add-in loads successfully resize it so that you can see the 'Run' button.
- Open Windows Task Manager and observe the memory use of Excel
- Click the 'Run' button repeatedly.
- Observe the memory usage for Excel continuing to climb each time Run is clicked.
- After clicking the button LOTS of times, notice how memory is just contnuing to rise unbounded
- Leave the app alone for 20 mins and notice that at some point the used memory returns to normal
When you click on that Run
button, the onclick
handler is this minimal function which calls Excel.run
with the simplest batch function possible.
Note: the more the batch function does with context
, the more memory is leaked on each click of Run