Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liveslots should free Remotables upon dispatch.dropExport #3137

Closed
warner opened this issue May 20, 2021 · 0 comments · Fixed by #3165
Closed

liveslots should free Remotables upon dispatch.dropExport #3137

warner opened this issue May 20, 2021 · 0 comments · Fixed by #3165
Assignees
Labels
enhancement New feature or request SwingSet package: SwingSet

Comments

@warner
Copy link
Member

warner commented May 20, 2021

What is the Problem Being Solved?

Once the VOM is holding on to Remotables wherever necessary (#3132), it is safe to have liveslots process dispatch.dropExport properly. This is the kernel's signal that neither the kernel nor any other vat can still reach the Remotable.

Upon receiving dropExport, liveslots should remove the Remotable from the (strong) exportedRemotables Set. This removes liveslots' last strong reference to the Remotable. If userspace is not keeping it alive in some other way (and the VOM isn't keeping it alive), the Remotable will eventually be released, along with any data it was holding in place. We expect this will free the bulk of the objects currently held by our vats.

(Note that the kernel won't actually call dropExport until #2946 is complete)

This is a component of #3106

Test Plan

A unit test (probably test-liveslots.js will build a liveslots instance without a kernel, and a simple vat. We'll use vatPowers to smuggle in WeakRef, so the vat code can sense if/when a Remotable goes away. Then the unit test will trigger dropExport and force a GC pass, then query the vat code to check that the WeakRef is empty.

@warner warner added enhancement New feature or request SwingSet package: SwingSet labels May 20, 2021
@warner warner self-assigned this May 20, 2021
warner added a commit that referenced this issue May 24, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
warner added a commit that referenced this issue May 24, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
warner added a commit that referenced this issue May 24, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
warner added a commit that referenced this issue May 24, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
warner added a commit that referenced this issue May 25, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
warner added a commit that referenced this issue May 25, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
warner added a commit that referenced this issue May 25, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
warner added a commit that referenced this issue May 25, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
warner added a commit that referenced this issue May 25, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
warner added a commit that referenced this issue May 25, 2021
Liveslots reacts to dispatch.dropExports by dropping the strong
`exportedRemotables` reference, possibly allowing the Remotable to be
collected.

closes #3137
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SwingSet package: SwingSet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant