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

Implement discarding Document objects to reclaim space. #14312

Merged
merged 5 commits into from Jan 4, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Updated comment.

  • Loading branch information
asajeffrey committed Jan 4, 2017
commit ef50a64598afe6096ae7649a6db2ddf54f6e13b1
@@ -1453,7 +1453,10 @@ impl Window {

pub fn freeze(&self) {
self.upcast::<GlobalScope>().suspend();
// A hint to the JS runtime that now would be a good time to GC this window.
// A hint to the JS runtime that now would be a good time to
// GC any unreachable objects generated by user script,
// or unattached DOM nodes. Attached DOM nodes can't be GCd yet,
// as the document might be thawed later.
self.Gc();

This comment has been minimized.

@jdm

jdm Jan 3, 2017

Member

This window will not be GCed because it is being accessed by a root that will prevent it being GCed. I'm not sure that this hint makes sense here.

This comment has been minimized.

@asajeffrey

asajeffrey Jan 4, 2017

Author Member

We are GCing user script data and unattached DOM nodes here. Attached DOM nodes can't be reclaimed.

This comment has been minimized.

@jdm

jdm Jan 4, 2017

Member

I guess I read "GC this window" as "GC this particular window object."

This comment has been minimized.

@asajeffrey

asajeffrey Jan 4, 2017

Author Member

Good point, the comment isn't as clear as it could be. I'll fix that.

}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.