does this sim do any memory management?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- frontend, performance
Research direction
Start by reading the memory-leak testing work in #32 and the documentation request in implementation-notes.md. Audit sim-specific uses of link, DerivedProperty, Multilink, Events.on, Emitter.addListener, and Node.on against their cleanup calls. Done means the relevant leaks and dispose requirements are addressed or documented, with the overall memory-management strategy recorded.
Written by the indexing model from the issue text.
Description
Related to #2 (code review), there are 3 items related to memory management:
- For each common-code component (sun, scenery-phet, vegas, …) that opaquely registers observers or listeners, is there a call to that component’s
disposefunction, or is it obvious why it isn't necessary, or is there documentation about whydisposeisn't called? An example of why no call todisposeis needed is if the component is used in aScreenViewthat would never be removed from the scene graph.- Are there leaks due to registering observers or listeners? The following guidelines should be followed unless there it is obviously no need to unlink, or documentation (in-line or in the implementation nodes)added about why following them is not necessary. Unlink is not needed for properties contained in classes that are never disposed of,
such as primary model and view classes that exist for the duration of the sim.
- [ ] AXON:Property.linkis accompanied byProperty.unlink.
- [ ] AXON: Creation ofDerivedPropertyis accompanied bydispose.
- [ ] AXON: Creation ofMultilinkis accompanied bydispose.
- [ ] AXON:Events.onis accompanied byEvents.off.
- [ ] AXON:Emitter.addListeneris accompanied byEmitter.removeListener.
- [ ] SCENERY:Node.onis accompanied byNode.off
- [ ] TANDEM: PhET-iO instrumentedPhetioObjectinstances should be disposed.- Do all types that require a
disposefunction have one? This should expose a publicdisposefunction that callsthis.disposeMyType(), wheredisposeMyTypeis a private function declared in the constructor.MyTypeshould exactly match the filename.
There are zero definitions of dispose in sim-specific code, and zero calls to dispose of common-code. That may be OK, or it may point to memory leaks.
Things to do:
- Test for memory leaks, see #32
- For each call to the functions mentioned above (e.g.
link), have an associated cleanup call (eg.unlink) or document why one is not needed. - Document overall memory management strategy in implementation-notes.md, see #8
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from phetsims/normal-modes
-
dev:typescript priority:5-deferred
Difficulty 5/5 Over a week Newbie friendliness 15/100
phetsims/normal-modes#92 ·
-
status:blocks-sim-publication
Difficulty 1/5 Under an hour Newbie friendliness 55/100
phetsims/normal-modes#90 ·
-
dev:code-review
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
phetsims/normal-modes#89 ·
-
priority:5-deferred type:bug type:multitouch
Difficulty 3/5 1-2 days Newbie friendliness 42/100
phetsims/normal-modes#87 · 1 comment ·
-
priority:5-deferred type:performance
Difficulty 3/5 1-2 days Newbie friendliness 42/100
phetsims/normal-modes#84 · 1 comment ·
All issues in phetsims/normal-modes
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openlibhums/janeway#5604 ·
Maintainers usually reply within 1 day
-
[BUG] Generic OSC does not initialize OSC client on startup when "Listen for Feedback" is disabledOpen
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
area/statement-execution TS conversion
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
scylladb/nodejs-rs-driver#584 ·
Maintainers usually reply within 2 days
-
新讀者走讀回報,照著一篇文章實際操作Opendocumentation good first issue help wanted
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 3 days