Re: [Python-Dev] PyGC_Collect ignores state of `enabled`

2016-05-20 Thread Neil Schemenauer
Nick Coghlan wrote: > PEP 3121 is insufficient, since a lot of extension modules can't (or > at least haven't) adopted it in practice. > https://www.python.org/dev/peps/pep-0489/ has some more background on > that (since it was the first step towards tackling the problem in a

Re: [Python-Dev] PyGC_Collect ignores state of `enabled`

2016-05-18 Thread Nick Coghlan
On 19 May 2016 at 05:04, Ethan Furman wrote: > On 05/18/2016 11:52 AM, Neil Schemenauer wrote: >> The whole finalize/shutdown logic of the CPython interpreter could >> badly use some improvement. Currently it is a set of ugly hacks >> piled on top of each other. Now that we

Re: [Python-Dev] PyGC_Collect ignores state of `enabled`

2016-05-18 Thread Ethan Furman
On 05/18/2016 11:52 AM, Neil Schemenauer wrote: Benjamin Peterson wrote: 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

Re: [Python-Dev] PyGC_Collect ignores state of `enabled`

2016-05-18 Thread Neil Schemenauer
Benjamin Peterson wrote: > 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. Yes,

Re: [Python-Dev] PyGC_Collect ignores state of `enabled`

2016-05-15 Thread Neil Schemenauer
Hi, I intended for gc.collect() to actually collect cycles even if the auto-GC was disabled. Having Py_Finalize() run GC even when it has been disabled seems wrong to me. Originally, cyclic GC was supposed to be optional. Back then, most programs did not leak cycles. I would vote for

Re: [Python-Dev] PyGC_Collect ignores state of `enabled`

2016-05-12 Thread Armin Rigo
Hi Lukasz, On 10 May 2016 at 04:13, Łukasz Langa wrote: > 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. Try to call

Re: [Python-Dev] PyGC_Collect ignores state of `enabled`

2016-05-09 Thread Benjamin Peterson
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

[Python-Dev] PyGC_Collect ignores state of `enabled`

2016-05-09 Thread Łukasz Langa
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