Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@alexandrtarasyuk
Copy link
Contributor

@alexandrtarasyuk alexandrtarasyuk commented Sep 18, 2018

Pull Request Checklist

Helpful things

Fixes

Should fix problem with TempFile objects not being released in memory (including proper deletion of underlining file).

Purpose

Remove tempFile from closure (to avoid strong reference to tempFile object preventing GC from triggering finalizeReferent of phantom reference).
As a result finalizeReferent method with deletePath is proper called when GC collects TempFile after usage.

Background Context

This issue was found as a result of memory leak investigation (all TempFile objects created are held in memory while play application is alive).

References

N/A

…bject preventing GC from triggering finalizeReferent of phantom reference)
Copy link
Member

@marcospereira marcospereira left a comment

Choose a reason for hiding this comment

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

LGTM. Good and subtle fix. :-)

Thank you, @alexandrtarasyuk. Let's just wait for a green build.

@mkurz mkurz merged commit 36eb967 into playframework:master Sep 18, 2018
marcospereira pushed a commit that referenced this pull request Sep 18, 2018
…bject preventing GC from triggering finalizeReferent of phantom reference) (#8614)
@marcospereira
Copy link
Member

Backport to 2.6.x: f9c05f6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants