A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2008-June/080764.html below:

[Python-Dev] C API for gc.enable() and gc.disable()

[Python-Dev] C API for gc.enable() and gc.disable() [Python-Dev] C API for gc.enable() and gc.disable()Greg Ewing greg.ewing at canterbury.ac.nz
Fri Jun 27 02:11:00 CEST 2008
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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4