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

Stephan Houben stephanh42 at gmail.com
Thu Oct 19 04:05:58 EDT 2017


Hi Steve,

2017-10-19 1:59 GMT+02:00 Steven D'Aprano <steve at pearwood.info>:

> On Wed, Oct 18, 2017 at 02:51:37PM +0200, Stefan Krah wrote:
>
> > $ softlimit -m 1000000000 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.
>
>
Yeah, not sure what "softlimit" is either.
I'd suggest sticking to POSIX-standard ulimit or just stick
something like this in the .pythonrc.py:

import resource
resource.setrlimit(resource.RLIMIT_DATA, (2 * 1024**3, 2 * 1024**3))

Nor (presumably) would this help Windows users.
>

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
(i.e.  a subsequent win32job.QueryInformationJobObject
still showed the limit as 0)?

People with stronger Windows-fu may be aware what is going on here...

Stephan


>
>
> --
> Steve
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171019/32b3313f/attachment.html>


More information about the Python-ideas mailing list