Subscribe on changes!

Potential memory leak with lazy loaded img hidden early

avatar
Jan 18th 2022

Version

3.2.27

Reproduction link

codesandbox.io

Steps to reproduce

  1. Open memory panel in chrome devtools, run the garbage collection, then take heap snapshot,
  2. Click twice on the "toggle" button,
  3. Run the garbage collection and take a heap snapshot again, filter by "Detached"
  4. Click a pair number of times on the "toggle" button,
  5. Run the garbage collection and take a heap snapshot again, filter by "Detached"

What is expected?

The number of detached elements should not increase after each pair of clicks

What is actually happening?

The number of detached elements is increasing after each pair of clicks

Screenshot_2022-01-18_10-17-52


  • Changing the "loading" prop to "eager" seems to remove the problem
  • Toggling the visibility of the img to false 1ms after mounted seem to also remove the problem
  • Using "v-show" or "v-if" to hide the img seem to lead to a memory leak in both cases

Relates to https://github.com/quasarframework/quasar/issues/11804

avatar
Apr 27th 2022

@CamilleDrapier there is a memory leak issue for images with lazy loading in browsers based on chromium. See https://bugs.chromium.org/p/chromium/issues/detail?id=1213045 https://groups.google.com/a/chromium.org/g/blink-reviews/c/-NRWulyMsR8?pli=1