Skip to content

Liveness analysis to avoid memory retention issues #35

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

Merged
merged 5 commits into from
Oct 26, 2013

Conversation

phaller
Copy link
Contributor

@phaller phaller commented Oct 22, 2013

  • Adds an iterative, backwards data-flow analysis
  • Make sure fields captured by nested defs are never zeroed out. This is done elegantly by declaring such fields a being live at the exit of the final state; thus, they will never be zeroed out.

- Iterative, backwards data-flow analysis
- Make sure fields captured by nested defs are never zeroed out.
  This is done elegantly by declaring such fields a being live
  at the exit of the final state; thus, they will never be
  zeroed out.
- A missing condition could cause an infinite loop
- Various clean-ups
- Adds a hook that lets a derived macro insert additional code
  when zero-ing out a lifted field.
- Adds a variant of the `AsyncId` macro that logs zeroed-out fields.
- Adds a test using this mechanism
- Zero out fields of type Any
- Zero out fields of value class type
@phaller
Copy link
Contributor Author

phaller commented Oct 22, 2013

Review by @retronym

protected[async] override def nullOut(u: Universe)(name: u.Expr[String], v: u.Expr[Any]): u.Expr[Unit] =
u.reify { scala.async.internal.AsyncTestLV(name.splice, v.splice) }
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be even nicer to define this in our test sources. But that will require us to rework the build a little bit as we need to separately compile this from the tests themselves. We can leave that as a todo before 1.0.

@retronym
Copy link
Member

LGTM. Nice small patch!

retronym added a commit that referenced this pull request Oct 26, 2013
Liveness analysis to avoid memory retention issues
@retronym retronym merged commit 2ec0c21 into scala:master Oct 26, 2013
@phaller phaller deleted the issue/memory-retention branch November 14, 2013 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants