Serhiy Storchaka added the comment: You increase internal index in a bytearray. A bytearray with small visible length can consume much hidden memory. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue19087> _______________________________________