Skip to content

v21 Accordion Regression Memory Leak #19215

@rosenthalj

Description

@rosenthalj

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
accordionMemoryLeak.mov

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

#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions