Re: [Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-20 Thread eryk sun
On Thu, Oct 19, 2017 at 9:05 AM, Stephan Houben wrote: > > I (quickly) tried to get something to work using the win32 package, > in particular the win32job functions. > However, it seems setting > "ProcessMemoryLimit" using win32job.SetInformationJobObject > had no effect >

Re: [Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-19 Thread Giampaolo Rodola'
On Thu, Oct 19, 2017 at 10:05 AM, Stephan Houben wrote: > Hi Steve, > > 2017-10-19 1:59 GMT+02:00 Steven D'Aprano : > >> On Wed, Oct 18, 2017 at 02:51:37PM +0200, Stefan Krah wrote: >> >> > $ softlimit -m 10 python3 >> [...] >> > MemoryError >>

Re: [Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-19 Thread Stefan Krah
On Thu, Oct 19, 2017 at 10:05:58AM +0200, Stephan Houben wrote: > > 2017-10-19 1:59 GMT+02:00 Steven D'Aprano : > > > On Wed, Oct 18, 2017 at 02:51:37PM +0200, Stefan Krah wrote: > > > > > $ softlimit -m 10 python3 > > [...] > > > MemoryError > > > > > > > > > People

Re: [Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-19 Thread Stephan Houben
Hi Steve, 2017-10-19 1:59 GMT+02:00 Steven D'Aprano : > On Wed, Oct 18, 2017 at 02:51:37PM +0200, Stefan Krah wrote: > > > $ softlimit -m 10 python3 > [...] > > MemoryError > > > > > > People who are worried could make a python3 alias or use Ctrl-\. > > I just tried

Re: [Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-18 Thread Steven D'Aprano
On Wed, Oct 18, 2017 at 02:51:37PM +0200, Stefan Krah wrote: > $ softlimit -m 10 python3 [...] > MemoryError > > > People who are worried could make a python3 alias or use Ctrl-\. I just tried that on two different Linux computers I have, and neither have softlimit. Nor (presumably)

Re: [Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-18 Thread Nick Coghlan
On 18 October 2017 at 22:51, Stefan Krah wrote: > On Wed, Oct 18, 2017 at 10:43:57PM +1000, Nick Coghlan wrote: > > Per-process memory quotas *can* help avoid this, but enforcing them > > requires that every process run in a resource controlled sandbox. Hence, > > it's not a

Re: [Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-18 Thread Koos Zevenhoven
On Wed, Oct 18, 2017 at 2:38 PM, Steven D'Aprano wrote: > On Wed, Oct 18, 2017 at 01:39:28PM +0300, Koos Zevenhoven wrote: > > > I'm writing from my phone now, cause I was dumb enough to try > list(count()) > > You have my sympathies -- I once, due to typo, accidentally ran

Re: [Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-18 Thread Stefan Krah
On Wed, Oct 18, 2017 at 10:43:57PM +1000, Nick Coghlan wrote: > Per-process memory quotas *can* help avoid this, but enforcing them > requires that every process run in a resource controlled sandbox. Hence, > it's not a coincidence that mobile operating systems and container-based > server

Re: [Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-18 Thread Nick Coghlan
On 18 October 2017 at 21:38, Steven D'Aprano wrote: > > But should it be fixed in list or in count? > > Neither. There are too many other places this can break for it to be > effective to try to fix each one in place. > > e.g. set(xrange(2**64)), or

[Python-ideas] Memory limits [was Re: Membership of infinite iterators]

2017-10-18 Thread Steven D'Aprano
On Wed, Oct 18, 2017 at 01:39:28PM +0300, Koos Zevenhoven wrote: > I'm writing from my phone now, cause I was dumb enough to try list(count()) You have my sympathies -- I once, due to typo, accidentally ran something like range(10**100) in Python 2. > But should it be fixed in list or in