Jeff Hall wrote:
I mistakenly thought that was because they were assumed to be small. It sounds like they're ignored because they're automatically collected and so they SHOULD be ignored for object garbage collection.

Strings aren't tracked by the cyclic garbage collector
because they don't contain object references and therefore
can't form part of a cycle.

However, unless I'm mistaken, allocations and deallocations
of them are still counted for the purpose of determining
when to perform a cyclic GC pass. So if you allocate lots
of strings and they aren't getting deallocated, a cyclic
GC pass will eventually occur, in case the strings are
being referenced from a cycle that can be cleaned up.

I don't know whether/how re uses string objects internally
while it's matching, so I can't say what its garbage
collection characteristics might be when matching against
a huge string.

The behaviour you observed might have been due to the
nature of the re being matched -- some res can have
quadratic or exponential behaviour all by themselves.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to