Comfy-Org / Comfy-Org/ComfyUI_frontend

Possible Memory Leak in Settings Panel

Open
#5,163 2 comments 0 reactions 0 assignees View on GitHub
perf:memory Potential Bug
Dominant language
TypeScript
Stars
2k
Forks
704
Avg merge
1d 8h
Merged PRs (30d)
512

Description

### Prerequisites

- [x] I am running the latest version of ComfyUI
- [x] I have searched existing issues to make sure this isn't a duplicate
- [x] I have tested with all custom nodes disabled ([see how](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled))

### What happened?

If you repeatedly open and close certain UI elements, I've only tested the settings panel and workflow templates view, they consistently increase the JS heap even after several GC runs.

### Steps to Reproduce

1. Go to performance tab on chrome devtools
2. Enable viewing memory
3. Start recording/profiling
4. Click and click out of settings menu or workflow templates
5. Click collect garbage
6. Stop recording
7. See that memory never goes back to original starting baseline

Or do a similar thing in the memory panel, seeing the detached DOM elements

### How is this affecting you?

Minor inconvenience

### ComfyUI Frontend Version

Stable 1.23.4 and nightly 1.26.6

### Browser

Chrome/Chromium

### Console Errors

```javascript

```

### Logs

```shell

```

### Additional Context

Most apparent with the workflow templates view

Click to view screenshots

Image
Image

traces timelines and snapshots were too big to upload :(

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-5163-Possible-Memory-Leak-in-Settings-Panel-2576d73d365081babe53e1a20bd4c851) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Research direction

Reproduce the leak in Chrome DevTools using the Performance or Memory panel while opening and closing the settings panel and workflow templates view, then collect garbage and inspect detached DOM elements. Trace the frontend components for those views and identify why their memory is retained; done means repeated open/close cycles no longer leave the JS heap above its post-GC baseline.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.