vsf-capybara
vsf-capybara copied to clipboard
Memory increases after each page reload.
Current behavior
Memory is never released and thus memory usage keeps increasing after each page reload. In the default VSF theme the template imports are tagged with webpackChunkName and thus dynamically imported, in the Capybara theme however the imports are missing the webpackChunkName comment, which seems to cause the memory leak.
Expected behavior
GC reclaims unused memory.
Steps to reproduce the issue
- Install the latest VSF with the Capybara theme in Docker.
- Run, configure and import the demo data set
- Run 'docker stats'
- Browse to your vsf instance and keep reloading the page.
- You should see the memory usage of your vsf container increase with each reload.
Can you handle fixing this bug by yourself?
- [X ] YES
- [ ] NO
Environment details
- Browser: Firefox 78.0.2 (64-bits)
- OS: Windows 10 pro 2006
- Code Version: latest Master (1.0.3)
Additional information
@one1note In which mode did you run VSF with Capybara theme: in development or production mode?
@psmyrek In production mode
Capybara theme uses multiple webpackChunkName
annotations for pages (they are configured in router/index.js
) and for other components (cart, search panel).
I've checked latest VSF with default theme and with Capybara theme and memory issue exists in both installation, in production mode, so this suggests that problem is somewhere else - outside Capybara theme, or even outside VSF - in external lib. This needs to be investigated.
VSF with default theme
VSF with Capybara theme
In both test cases Homepage was reloaded every 2-3 seconds.
We've found that the main reason for memory leaks in our case was this change: https://github.com/vuestorefront/vsf-capybara/pull/45#discussion_r365103985