Index: Python/marshal.c =================================================================== --- Python/marshal.c (revision 64290) +++ Python/marshal.c (working copy) @@ -67,7 +67,7 @@ size = PyString_Size(p->str); newsize = size + size + 1024; if (newsize > 32*1024*1024) { - newsize = size + 1024*1024; + newsize = size + (size >> 3); /* 12.5% overallocation */ } if (_PyString_Resize(&p->str, newsize) != 0) { p->ptr = p->end = NULL;