selecto icon indicating copy to clipboard operation
selecto copied to clipboard

Memory leak

Open axetroy opened this issue 1 month ago • 0 comments

Environments

  • Framework name: none
  • Framework version: none
  • Component name: none
  • Component version:none
  • Testable Address(optional):none

Description

I found that after each instantiation, there would be Selecto instances that were not destroyed and kept occupying memory.

I have such a scenario, which often needs to be created and then destroyed, which brings memory leaks to my application.

Here are the steps I took to reproduce:

  1. Open story book welcome page and open devTool
  2. Trigger GC in devTool
  3. Take memory snapshot 1
  4. Open another page in storage book (eg. Select in real time)
  5. Go back to story book welcome page
  6. Trigger GC in devTool
  7. Take memory snapshot 2

Snapshot 1:

截屏2024-06-01 13 14 23

Snapshot 2: 截屏2024-06-01 13 15 15

Diff snapshot:

截屏2024-06-01 13 11 07

Theoretically, when the page is switched, the Selecto object should be destroyed and recycled by GC, but in fact it is not.

Selecto@295827 Still accessible

axetroy avatar Jun 01 '24 05:06 axetroy