[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-15 Thread STINNER Victor
STINNER Victor added the comment: > Victor, please read your own link before posting: Oh. I missed this part, that's why I didn't understand Tim's remark. So the issue comes the Windows heap allocator. I don't see any obvious improvment that Python can do to improve the memory usage. I close t

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > It should be enabled explicitly. Victor, please read your own link before posting: """The information in this topic applies to Windows Server 2003 and Windows XP. Starting with Windows Vista, the system uses the low-fragmentation heap (LFH) as needed to servi

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-15 Thread STINNER Victor
STINNER Victor added the comment: Tim> http://msdn.microsoft.com/en-us/library/windows/desktop/aa366750(v=vs.85).aspx Yes, this one. Tim> BTW, everything I've read (including the MSDN page I linked to) says that the LFH is enabled _by default_ starting in Windows Vista (which I happen to be us

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Tim Peters
Tim Peters added the comment: BTW, everything I've read (including the MSDN page I linked to) says that the LFH is enabled _by default_ starting in Windows Vista (which I happen to be using). So unless Python does something to _disable_ it (I don't know), there's nothing to try here. ---

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Tim Peters
Tim Peters added the comment: @haypo, I'm not sure what you mean by "the low fragmentation allocator". If it's referring to this: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366750(v=vs.85).aspx it doesn't sound all that promising for this failing case. But, sure, someone shou

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread STINNER Victor
STINNER Victor added the comment: I tried jemalloc on Linux which behaves better than the (g)libc on the RSS ans VMS memory. I know that Firefox uses it on Windows (and maybe also Mac OS X). It may be interesting to try it and/or provide something to use it easily. -- __

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread STINNER Victor
STINNER Victor added the comment: > Anyway, since "the problem" has been produced with a simple pure C program, I think we need to close this as "wont fix". Can someone try the low fragmentation allocator? -- ___ Python tracker

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Tim Peters
Tim Peters added the comment: @sbt, excellent! Happens for me too: trying to allocate a 1MB block fails after running ugly_hack() once. That fits the symptoms: lots of smaller, varying-sized allocations, followed by free()s, followed by a "largish" allocation. Don't know _exactly_ which l

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Richard Oudkerk
Richard Oudkerk added the comment: After running ugly_hack(), trying to malloc a largeish block (1MB) fails: int main(void) { int first; void *ptr; ptr = malloc(1024*1024); assert(ptr != NULL);/* succeeds */ free(ptr); first = ugly_hack(); ptr = malloc(1024

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Brian Curtin
Changes by Brian Curtin : -- nosy: -brian.curtin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Tim Peters
Tim Peters added the comment: Just to be sure, I tried under current default (3.4.0a3+). Same behavior. -- ___ Python tracker ___ ___

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > @pitrou, maybe, but seems very unlikely. As explained countless times > already ;-), Indeed, a 32-bit counter would already have overflowed :-D You're right that's very unlikely. -- ___ Python tracker

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Tim Peters
Tim Peters added the comment: @pitrou, maybe, but seems very unlikely. As explained countless times already ;-), PyMalloc allocates few arenas in the test program. "Small objects" are relatively rare here. Almost all the memory is consumed by strings of ever-increasing length. PyMalloc pas

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: By the way, in Python 3.4 arena allocation is done using VirtualAlloc and VirtualFree, that may make a difference too. -- ___ Python tracker __

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Tim Peters
Tim Peters added the comment: @Esa.Peuha, fine idea! Alas, on the same box I used before, uglyhack.c displays (it varies a tiny amount from run to run): 65198 65145 99.918709% So it's not emulating enough of Python's malloc()/free() behavior to trigger the same kind of problem :-( -

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Tim Peters
Tim Peters added the comment: @haypo, this has nothing to do with PyMalloc. As I reported in my first message, only 7 PyMalloc arenas are in use at the end of the program, less than 2 MB total. *All* other arenas ever used were released to the OS. And that's not surprising. The vast bulk of

[issue19246] freeing then reallocating lots of memory fails under Windows

2013-10-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- title: GC does not really free up memory in console -> freeing then reallocating lots of memory fails under Windows ___ Python tracker ___ ___