Annotations leak memory
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.2k
- Forks
- 589
- PR merge metrics
- No merged PRs in 30d
Description
We are adding and removing dozens of annotations per minute. Both are done by modifying an array and then calling setAnnotations. Now we have had problems with heavy memory usage and the annotations seems to be the cause for that.
For me it seems, that annotations plugin leaks memory via event handlers with in two ways:
- removeEventListener for div elements is never called
- "addAndTrackEvent" pushes events to "registeredEvents_" array, but they are never removed from there.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the annotations plugin and tracing setAnnotations, addAndTrackEvent, registeredEvents_, and the event-handler cleanup path. Reproduce repeated annotation additions and removals, then verify that div listeners are removed and registeredEvents_ does not retain obsolete events or grow indefinitely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100