[Python-Dev] PyGC_Collect ignores state of `enabled`
Benjamin Peterson
benjamin at python.org
Tue May 10 01:55:51 EDT 2016
More information about the Python-Dev mailing list
Tue May 10 01:55:51 EDT 2016
- Previous message (by thread): [Python-Dev] PyGC_Collect ignores state of `enabled`
- Next message (by thread): [Python-Dev] PyGC_Collect ignores state of `enabled`
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Adding PyGC_CollectIfEnabled() and calling it in Py_Finalize is probably fine. I don't think the contract of PyGC_Collect itself (or gc.collect() for that matter) should be changed. You might want to disable GC but invoke it yourself. On Mon, May 9, 2016, at 19:13, Łukasz Langa wrote: > Is this deliberate? Could we change it for 3.6 so PyGC_Collect does take > `enabled` into account? > > Context: we’re experimenting with disabling the gc entirely for some > workloads because it doesn’t fare too well with Copy-on-Write on Linux. > What ends up happening is that disabling the gc actually drops memory > usage significantly if you’re using hundreds of the same processes on one > box :-) > > However, because of PyGC_Collect() called in Py_Finalize(), during > interpreter shutdown the collection is done anyway, Linux does CoW and > the memory usage spikes. Which is ironic on process shutdown. > > -- > Lukasz Langa | Facebook > Production Engineer | The Ministry of Silly Walks > (+1) 650-681-7811 > > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/benjamin%40python.org > Email had 1 attachment: > + signature.asc > 1k (application/pgp-signature)
- Previous message (by thread): [Python-Dev] PyGC_Collect ignores state of `enabled`
- Next message (by thread): [Python-Dev] PyGC_Collect ignores state of `enabled`
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list