Re: Python 2.7 range Function provokes a Memory Error

2023-03-06 Thread Chris Angelico
On Tue, 7 Mar 2023 at 16:53, Stephen Tucker wrote: > > Hi again, > > I tried xrange, but I got an error telling me that my integer was too big > for a C long. > > Clearly, xrange in Py2 is not capable of dealing with Python (that is, > possibly very long) integers. That's because Py2 has two

Re: Python 2.7 range Function provokes a Memory Error

2023-03-06 Thread Stephen Tucker
ibbens via Python-list < python-list@python.org> wrote: > On 2023-03-02, Stephen Tucker wrote: > > The range function in Python 2.7 (and yes, I know that it is now > > superseded), provokes a Memory Error when asked to deiliver a very long > > list of values. > > >

Re: Python 2.7 range Function provokes a Memory Error

2023-03-02 Thread Jon Ribbens via Python-list
On 2023-03-02, Stephen Tucker wrote: > The range function in Python 2.7 (and yes, I know that it is now > superseded), provokes a Memory Error when asked to deiliver a very long > list of values. > > I assume that this is because the function produces a list which it then >

Re: Python 2.7 range Function provokes a Memory Error

2023-03-02 Thread Chris Angelico
On Thu, 2 Mar 2023 at 22:27, Stephen Tucker wrote: > > Hi, > > The range function in Python 2.7 (and yes, I know that it is now > superseded), provokes a Memory Error when asked to deiliver a very long > list of values. > > I assume that this is because the functi

Re: Python 2.7 range Function provokes a Memory Error

2023-03-02 Thread 2QdxY4RzWzUUiLuE
On 2023-03-02 at 11:25:49 +, Stephen Tucker wrote: > The range function in Python 2.7 (and yes, I know that it is now > superseded), provokes a Memory Error when asked to deiliver a very long > list of values. > > I assume that this is because the function produc

Python 2.7 range Function provokes a Memory Error

2023-03-02 Thread Stephen Tucker
Hi, The range function in Python 2.7 (and yes, I know that it is now superseded), provokes a Memory Error when asked to deiliver a very long list of values. I assume that this is because the function produces a list which it then iterates through. 1. Does the range function in Python 3.x

Why do I see digest replies to posts I never saw in a digest? [was: RE: Why I fail so bad to check for memory leak with this code?]

2022-07-23 Thread pjfarley3
Barry > Cc: MRAB ; Python-list@python.org > Subject: Re: Why I fail so bad to check for memory leak with this code? > > On Fri, 22 Jul 2022 at 09:00, Barry wrote: > > With code as complex as python’s there will be memory allocations that > occur that will not be directly re

Re: Why I fail so bad to check for memory leak with this code?

2022-07-22 Thread Marco Sulla
On Fri, 22 Jul 2022 at 09:00, Barry wrote: > With code as complex as python’s there will be memory allocations that occur that will not be directly related to the python code you test. > > To put it another way there is noise in your memory allocation signal. > > Usually the sig

Re: Why I fail so bad to check for memory leak with this code?

2022-07-22 Thread Barry
e.dumps(iter([])) > > It's too strange. I found a bunch of true memory leaks with this > decorator. It seems to be reliable. It's correct with pickle and with > iter, but not when pickling iters. With code as complex as python’s there will be memory allocations that occur that will

Re: Why I fail so bad to check for memory leak with this code?

2022-07-21 Thread MRAB
It seems that, after 10 million loops, only 63 have a leak, with only ~3 KB. It seems to me that we can't call it a leak, no? Probably pickle needs a lot more cycles to be sure there's actually a real leakage. If it was a leak, then the amount of memory used or the counts would increase

Re: Why I fail so bad to check for memory leak with this code?

2022-07-21 Thread Marco Sulla
I've done this other simple test: #!/usr/bin/env python3 import tracemalloc import gc import pickle tracemalloc.start() snapshot1 = tracemalloc.take_snapshot().filter_traces( (tracemalloc.Filter(True, __file__), ) ) for i in range(1000): pickle.dumps(iter([])) gc.collect()

Re: Why I fail so bad to check for memory leak with this code?

2022-07-21 Thread Marco Sulla
This naif code shows no leak: import resource import pickle c = 0 while True: pickle.dumps(iter([])) if (c % 1) == 0: max_rss = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss print(f"iteration: {c}, max rss: {max_rss} kb") c += 1 --

Re: Why I fail so bad to check for memory leak with this code?

2022-07-21 Thread Marco Sulla
On Thu, 21 Jul 2022 at 22:28, MRAB wrote: > > It's something to do with pickling iterators because it still occurs > when I reduce func_76 to: > > @trace > def func_76(): > pickle.dumps(iter([])) It's too strange. I found a bunch of true memory leaks with thi

Re: Why I fail so bad to check for memory leak with this code?

2022-07-21 Thread MRAB
On 21/07/2022 20:47, Marco Sulla wrote: I tried to check for memory leaks in a bunch of functions of mine using a simple decorator. It works, but it fails with this code, returning a random count_diff at every run. Why? import tracemalloc import gc import functools from uuid import uuid4 import

Why I fail so bad to check for memory leak with this code?

2022-07-21 Thread Marco Sulla
I tried to check for memory leaks in a bunch of functions of mine using a simple decorator. It works, but it fails with this code, returning a random count_diff at every run. Why? import tracemalloc import gc import functools from uuid import uuid4 import pickle def getUuid(): return str

[issue478005] possible memory leak in posixmodule.c

2022-04-10 Thread admin
Change by admin : -- github: None -> 35464 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue478003] possible memory leaks in err handling

2022-04-10 Thread admin
Change by admin : -- github: None -> 35463 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue219862] Memory leak in python 2.0 and below

2022-04-10 Thread admin
Change by admin : -- github: None -> 33422 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue210653] Assigning function objects to instance variable causes memory leak (PR#346)

2022-04-10 Thread admin
Change by admin : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue402868] fileobject.c:get_line leaks memory when hitting EOF

2022-04-10 Thread admin
Change by admin : -- github: None -> 33602 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue489669] memory leak in test_descr (unicode)

2022-04-10 Thread admin
Change by admin : -- github: None -> 35673 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue485150] memory leak from marshal.c (test_email)

2022-04-10 Thread admin
Change by admin : -- github: None -> 35580 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue513725] memory leak in VC6++

2022-04-10 Thread admin
Change by admin : -- github: None -> 36036 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue485152] memory leak in test_scope

2022-04-10 Thread admin
Change by admin : -- github: None -> 35581 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue485142] memory leak in test_binop

2022-04-10 Thread admin
Change by admin : -- github: None -> 35578 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue461611] listextend memory leak

2022-04-10 Thread admin
Change by admin : -- github: None -> 35172 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue416288] infrequent memory leak in pyexpat

2022-04-10 Thread admin
Change by admin : -- github: None -> 34342 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue233489] compile leaks memory (current CVS)

2022-04-10 Thread admin
Change by admin : -- github: None -> 33987 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue227699] Memory leaks using imp.load_module

2022-04-10 Thread admin
Change by admin : -- github: None -> 33664 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue535495] threading.RLock memory leak

2022-04-10 Thread admin
Change by admin : -- github: None -> 36338 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue535474] xml.sax memory leak with ExpatParser

2022-04-10 Thread admin
Change by admin : -- github: None -> 36337 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue228040] memory leak with multiple Py_Initialize/Py_Finalize calls

2022-04-10 Thread admin
Change by admin : -- github: None -> 33675 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue227470] Memory leak in bdb

2022-04-10 Thread admin
Change by admin : -- github: None -> 33660 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue540952] Memory Usage Reporting

2022-04-10 Thread admin
Change by admin : -- github: None -> 36395 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue520045] memory leak in descr_new

2022-04-10 Thread admin
Change by admin : -- github: None -> 36123 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue401229] Optional memory profiler

2022-04-10 Thread admin
Change by admin : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue501716] "es#" parser marker leaks memory

2022-04-10 Thread admin
Change by admin : -- github: None -> 35896 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue494320] Memory leaks in 2.2c1?

2022-04-10 Thread admin
Change by admin : -- github: None -> 35770 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue489673] memory leak in test_symtable

2022-04-10 Thread admin
Change by admin : -- github: None -> 35677 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue485145] memory leak in test_unicode

2022-04-10 Thread admin
Change by admin : -- github: None -> 35579 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue494738] binascii_b2a_base64 overwrites memory

2022-04-10 Thread admin
Change by admin : -- github: None -> 35779 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue474538] Memory (reference) leak in poller.regis

2022-04-10 Thread admin
Change by admin : -- github: None -> 35397 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue478006] memory leaks in Modules & threads

2022-04-10 Thread admin
Change by admin : -- github: None -> 35465 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue489671] memory leak in test_richcmp

2022-04-10 Thread admin
Change by admin : -- github: None -> 35675 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue489670] memory leak in test_re

2022-04-10 Thread admin
Change by admin : -- github: None -> 35674 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue489672] memory leak in test_sre

2022-04-10 Thread admin
Change by admin : -- github: None -> 35676 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue484977] memory leaks with new style classes

2022-04-10 Thread admin
Change by admin : -- github: None -> 35572 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue472568] PyBuffer_New() memory not aligned

2022-04-10 Thread admin
Change by admin : -- github: None -> 35351 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue485133] memory leak in test_parser

2022-04-10 Thread admin
Change by admin : -- github: None -> 35576 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue477700] memory leaks in gdbm & curses

2022-04-10 Thread admin
Change by admin : -- github: None -> 35454 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue456504] Memory leak in PyString_FromString

2022-04-10 Thread admin
Change by admin : -- github: None -> 35073 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue462710] Python 2.2a3/XML leaks memory

2022-04-10 Thread admin
Change by admin : -- github: None -> 35197 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue417795] Fix memory cycles in Weak*Dictionary

2022-04-10 Thread admin
Change by admin : -- github: None -> 34383 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue416187] API problem causes unicode memory leak

2022-04-10 Thread admin
Change by admin : -- github: None -> 34328 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue415660] Weak references cause illegal memory ref

2022-04-10 Thread admin
Change by admin : -- github: None -> 34315 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue403753] zlib decompress; uncontrollable memory usage

2022-04-10 Thread admin
Change by admin : -- github: None -> 33910 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue402847] fix a memory leak

2022-04-10 Thread admin
Change by admin : -- github: None -> 33592 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue229179] Memory leak on repeated reloads

2022-04-10 Thread admin
Change by admin : -- github: None -> 33744 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue403248] Fix a memory leak in _sre.c

2022-04-10 Thread admin
Change by admin : -- github: None -> 33726 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue228079] memory leak in pyexpat parser

2022-04-10 Thread admin
Change by admin : -- github: None -> 33677 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue226587] sre matchobject,groupdict() seems to memory leak

2022-04-10 Thread admin
Change by admin : -- github: None -> 33625 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue402863] another memory leak

2022-04-10 Thread admin
Change by admin : -- github: None -> 33600 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue402868] fileobject.c:get_line leaks memory when hitting EOF

2022-04-10 Thread admin
Change by admin : -- github: None -> 33602 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue224038] CGI : Uploaded file is whole stored in memory

2022-04-10 Thread admin
Change by admin : -- github: None -> 33530 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue403253] Plug memory leak in posixmodule.c

2022-04-10 Thread admin
Change by admin : -- github: None -> 33730 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue403179] Memory leak fix - partial fix for bug #127699

2022-04-10 Thread admin
Change by admin : -- github: None -> 33693 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue222684] Memory leak creating sub-interpreters

2022-04-10 Thread admin
Change by admin : -- github: None -> 33488 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue219806] cgi.py uses too much memory on large file uploads

2022-04-10 Thread admin
Change by admin : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue221654] sre regex () groups have strong memory

2022-04-10 Thread admin
Change by admin : -- github: None -> 33447 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue221060] memory leak in python 2.0

2022-04-10 Thread admin
Change by admin : -- github: None -> 33434 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue219862] Memory leak in python 2.0 and below

2022-04-10 Thread admin
Change by admin : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue216267] zlib.decompress memory allocation "infinite" loop

2022-04-10 Thread admin
Change by admin : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue400974] Vlad's dynamic introspective memory allocator for Python

2022-04-10 Thread admin
Change by admin : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue210674] memory bloat in binary file upload (PR#381)

2022-04-10 Thread admin
Change by admin : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue210681] memory leak in loops (PR#398)

2022-04-10 Thread admin
Change by admin : ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue402863] another memory leak

2022-04-10 Thread admin
Change by admin : -- github: None -> 33600 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue219806] cgi.py uses too much memory on large file uploads

2022-04-10 Thread admin
Change by admin : -- github: None -> 33418 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue402847] fix a memory leak

2022-04-10 Thread admin
Change by admin : -- github: None -> 33592 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue222684] Memory leak creating sub-interpreters

2022-04-10 Thread admin
Change by admin : -- github: None -> 33488 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue224038] CGI : Uploaded file is whole stored in memory

2022-04-10 Thread admin
Change by admin : -- github: None -> 33530 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue221060] memory leak in python 2.0

2022-04-10 Thread admin
Change by admin : -- github: None -> 33434 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue221654] sre regex () groups have strong memory

2022-04-10 Thread admin
Change by admin : -- github: None -> 33447 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue216267] zlib.decompress memory allocation "infinite" loop

2022-04-10 Thread admin
Change by admin : -- github: None -> 33300 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue401229] Optional memory profiler

2022-04-10 Thread admin
Change by admin : -- github: None -> 32959 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue210681] memory leak in loops (PR#398)

2022-04-10 Thread admin
Change by admin : -- github: None -> 32751 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue210674] memory bloat in binary file upload (PR#381)

2022-04-10 Thread admin
Change by admin : -- github: None -> 32744 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue210653] Assigning function objects to instance variable causes memory leak (PR#346)

2022-04-10 Thread admin
Change by admin : -- github: None -> 32724 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue400974] Vlad's dynamic introspective memory allocator for Python

2022-04-10 Thread admin
Change by admin : -- github: None -> 32649 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23689] Memory leak in Modules/sre_lib.h

2022-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Ma Lin for all your work. The fix changes interfaces of some internal functions which can be used in third-party code, and the bug occurs only in special circumstances, so it is not practical to backport it. -- resolution: -> fixed

[issue23689] Memory leak in Modules/sre_lib.h

2022-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6e3eee5c11b539e9aab39cff783acf57838c355a by Ma Lin in branch 'main': bpo-23689: re module, fix memory leak when a match is terminated by a signal or memory allocation failure (GH-32283) https://github.com/python/cpython/commit

[issue23689] Memory leak in Modules/sre_lib.h

2022-04-03 Thread Ma Lin
Change by Ma Lin : -- pull_requests: +30344 pull_request: https://github.com/python/cpython/pull/32283 ___ Python tracker ___ ___

[issue23689] Memory leak in Modules/sre_lib.h

2022-03-31 Thread Ma Lin
Change by Ma Lin : -- pull_requests: +30298 pull_request: https://github.com/python/cpython/pull/32223 ___ Python tracker ___ ___

[issue23689] Memory leak in Modules/sre_lib.h

2022-03-30 Thread Ma Lin
Change by Ma Lin : -- pull_requests: +30265 pull_request: https://github.com/python/cpython/pull/32188 ___ Python tracker ___ ___

[issue23689] Memory leak in Modules/sre_lib.h

2022-03-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks promising. Please, go ahead! You are free to add any fields to any opcodes. It may break some third-party code which generates compiled patterns from a sequence of opcodes, it the stability of this interface was not promised. And they will be

[issue23689] Memory leak in Modules/sre_lib.h

2022-03-29 Thread Ma Lin
Ma Lin added the comment: My PR methods are suboptimal, so I closed them. The number of REPEAT can be counted when compiling a pattern, and allocate a `SRE_REPEAT` array in `SRE_STATE` (with that number items). It seem at any time, a REPEAT will only have one in active, so a `SRE_REPEAT`

[issue46799] ShareableList memory bloat and performance improvement

2022-03-27 Thread Ting-Che Lin
Ting-Che Lin added the comment: A gentle Ping to the multiprocessing lib maintainers. Is there anything else I can do to move this forward? -- resolution: -> remind ___ Python tracker

[issue46657] Add mimalloc memory allocator

2022-03-23 Thread h-vetinari
Change by h-vetinari : -- nosy: +h-vetinari ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46997] Invalid memory write in bytearray

2022-03-12 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: 3.9 segfaults. (gdb) bt #0 bytearray_ass_subscript (self=, index=0x77e118f0, values=0x76f918b0) at Objects/bytearrayobject.c:640 #1 0x00536302 in _PyEval_EvalFrameDefault (tstate=, f=0x999a80, throwflag=) at Python/ceval.c:1990 #2

[issue46997] Invalid memory write in bytearray

2022-03-12 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- components: +Interpreter Core versions: +Python 3.10, Python 3.11 ___ Python tracker ___ ___

[issue46997] Invalid memory write in bytearray

2022-03-12 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : Inspired by Guido's comment in https://github.com/python/cpython/pull/31834/files#r825352900, I found that there are some places in bytearrayobject.c where we can write to free'd memory if we encounter an object with a sneaky __index__ method: $ cat

  1   2   3   4   5   6   7   8   9   10   >