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

Bundle Import: Reduce memory footprint #3270

Merged
merged 1 commit into from Aug 11, 2017
Merged

Conversation

lukasgraf
Copy link
Member

@lukasgraf lukasgraf commented Aug 10, 2017

These changes aim to reduce the memory (RSS) footprint of a bundle import, particularly the high-water-mark.

While I was able to clean up some leaking references in earlier pull requests (x, y), that wasn't enough to significantly bring down max. memory usage.

At some point I discovered that re-setting the Plone site using the getSite() hook finally manages to get rid of those leaking references, and allows the Python garbage collector to do its job. In addition, the cPickleCache also needs to be garbage collected periodically.

So, in regular intervals the following things need to happen:

  • Creating transaction savepoints
  • Re-setting the Plone site using setSite()
  • Garbage collecting the cPickleCache
  • Python garbage collection (optional, doesn't effect high-water-mark)

I can't yet say what exact impact the interval has, and whether this is the optimal order, but at least the first three need to happen in order to get a significant reduction in the memory high-water-mark.

memory

Backported to: 2017.4-stable

…ng the

Plone site using setSite(), and garbage collecting the cPickleCache.
@lukasgraf
Copy link
Member Author

@phgross thise one is now ready, and tested again.

Copy link
Member

@phgross phgross left a comment

Choose a reason for hiding this comment

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

👍

@phgross phgross merged commit 60f4053 into master Aug 11, 2017
@phgross phgross deleted the lg-bundle-memory-usage branch August 11, 2017 08:22
phgross added a commit that referenced this pull request Aug 11, 2017
Bundle Import: Reduce memory footprint
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.

None yet

2 participants