primeng icon indicating copy to clipboard operation
primeng copied to clipboard

v21 Accordion Regression Memory Leak

Open rosenthalj opened this issue 11 months ago • 2 comments

Describe the bug

PrimeNG v21 Accordion functionality has a regression memory leak. This regression was fixed in v19 (Closed Issue #18296) and was also fixed in v20(Closed Issue #18546).

The video listed below demonstrates the issue with v21 Accordion. Video Notes:

  1. At the start of the video, I hard refresh the page. This clears the page's memory
  2. In the Video I navigate away from the Accordion Demo Page 3 times -- I navigate from the Accordion page to the "about page" because 'about page' is a very simple page
  3. I use the Chrome Development Tool's Memory Profiler to take a snapshot of the browsers JavaScript VM memory (profiling type = detached elements)
  4. Chrome has detected 3 detached Accordion elements

https://github.com/user-attachments/assets/e456967f-bae9-4bab-838f-e07892979ac9

I "arbitrarily" tested (following similar steps) a few PrimeNG Components that I use in my application:

  1. MegaMenu, MultiSelect, Select, SelectButton did not appear to have a memory leak
  2. Table appears to also have a memory leak

Pull Request Link

https://github.com/primefaces/primeng/pull/19220

Reproducer

https://primeng.org/accordion

Environment

N/A

Angular version

21+

PrimeNG version

v21

Node version

n/a

Browser(s)

all browsers

Steps to reproduce the behavior

See closed Issue #18546 "Steps" on how to reproduce the bug

Expected behavior

No memory leak.

rosenthalj avatar Dec 16 '25 13:12 rosenthalj

any update on this? are they going to use your PR @rosenthalj or use another solution?

bvx5009 avatar Feb 06 '26 16:02 bvx5009

any update on this? are they going to use your PR @rosenthalj or use another solution?

@bvx5009 this bug should have been closed when issue #19250 was close

The fix is in the current version of PrimNG v21 Note: the bug was fixed with PR v21 DynamicDialog Memory Leak #19227 (which include the change in PR #19220)

I'm closing this issue

rosenthalj avatar Feb 06 '26 16:02 rosenthalj