Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/19440.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add log to explain when and why we freeze objects in the garbage collector.
5 changes: 5 additions & 0 deletions synapse/app/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,11 @@ def log_shutdown() -> None:
#
# PyPy does not (yet?) implement gc.freeze()
if hasattr(gc, "freeze"):
logger.info(
"garbage collector: Freezing all allocated objects in the hopes that (almost) "
"everything currently allocated are things that will be used by the homeserver "
"for the rest of time. Doing so means less work each GC (hopefully)."
)
Comment on lines +779 to +783
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the same language used in the comment above. I think it's worth having some explanation here.

gc.collect()
gc.freeze()

Expand Down
Loading