Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Manually run GC on reactor tick. #771

Merged
merged 3 commits into from
Jun 7, 2016
Merged

Manually run GC on reactor tick. #771

merged 3 commits into from
Jun 7, 2016

Conversation

erikjohnston
Copy link
Member

This also adds a metric for amount of time spent in GC.

This also adds a metric for amount of time spent in GC.
logger.info("Collecting gc %d", i)
gc.collect(i)
end = time.time() * 1000
gc_time.inc_by(end - start)
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be interesting to collect stats about the different levels of collection going on.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oooh, yes, good point.

@ara4n
Copy link
Member

ara4n commented May 13, 2016

this seems really weird - surely GCs can be very costly with lots of objects, especially for the higher generations? Why would you want to run it on every reactor tick? Wouldn't it be better to bump up the GC thresholds and just have the machine stop the world to GC once every few hours or whatever?

@erikjohnston
Copy link
Member Author

@ara4n We check if we need to run the GC on each reactor tick, we don't necessarily do so. The check should be equivalent to the one done internally by python

@ara4n
Copy link
Member

ara4n commented May 13, 2016

okay... but what is the rationale for doing so? (aka where are the comments?)

@erikjohnston
Copy link
Member Author

Sure I can add a comment. It's mainly so that we can get some metrics over how long we spend GC'ing

@ara4n
Copy link
Member

ara4n commented May 13, 2016

aaah! makes much more sense - thanks :)

@NegativeMjark
Copy link
Contributor

LGTM. Might want to be careful about merging this to make sure it doesn't end up on one of our servers by accident.

@erikjohnston erikjohnston merged commit 8c966fb into develop Jun 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants