Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Do we need to call gc.collect() occasionally through the event loop? #42

Closed
GoogleCodeExporter opened this issue Apr 10, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

I closed issue 41 as fixed, but there's one missing piece: abandoned tracebacks 
only get printed when the Future is garbage-collected.  If nothing else is 
going on this may take a while.  Perhaps we should have some heuristic in 
_run_once() that occasionally calls gc.collect()?

Every time _run_once() is called is probably too often -- maybe we should call 
it at most once a second?

Original issue reported on code.google.com by gvanrossum@gmail.com on 3 May 2013 at 10:20

@GoogleCodeExporter
Copy link
Author

Original comment by gvanrossum@gmail.com on 16 Oct 2013 at 4:42

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

This came up again in the context of a CPython issue:
http://bugs.python.org/issue20032

However, Victor wrote there: "I don't like such task. The issue can be 
documented, maybe with an example of call calling gc.collect() regulary? Such 
background task should be implemented in the application to control when the 
garbage collector is called."

Original comment by gvanrossum@gmail.com on 20 Dec 2013 at 10:39

  • Changed state: New

@GoogleCodeExporter
Copy link
Author

I think it's a job for a higher level code -- i.e. an HTTP server can call 
gc.collect() when the rate of new requests is low etc. Putting this into the 
loop directly, where we don't have enough context about the actual task the 
loop is performing, is IMHO, redundant.

Original comment by yseliva...@gmail.com on 11 Feb 2014 at 12:56

@GoogleCodeExporter
Copy link
Author

OTOH what is the cost? (I honestly don't know how efficient calling 
gc.collect() frequently is, these days. And I suppose that when a server is the 
most busy, that's when it might be needed the most, and it would be called 
relatively infrequently.)

Original comment by gvanrossum@gmail.com on 11 Feb 2014 at 1:05

@GoogleCodeExporter
Copy link
Author

Original comment by victor.s...@gmail.com on 18 Jun 2014 at 12:48

  • Changed state: Duplicate

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant