A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-December/059258.html below:

[Python-Dev] suggestion for smarter garbage collection in function of size (gc.set_collect_mem_growth(2))

[Python-Dev] suggestion for smarter garbage collection in function of size (gc.set_collect_mem_growth(2))Bob Ippolito bob at redivi.com
Thu Dec 29 10:22:35 CET 2005
On Dec 27, 2005, at 9:05 AM, Andrea Arcangeli wrote:

> I run into a problem recently with a reconnectingclientfactory with
> twisted while write some spare time software, that turned out to be  
> a gc
> inefficiency.
>
> In short the protocol memory wasn't released after the reconnect  
> and the
> protocol had about 50M attached to it. So with frequent reconnects the
> rss of the task grown to >1G and it pushed the system into heavy swap.
> In reality only 50M were allocated, so 950M were wasted by python.

In this particular case, you might be better off just writing some  
Twisted code that periodically checks the size of the current process  
and does a gc.collect() when necessary.  Of course, it requires some  
platform specific code, but presumably you only care about one, maybe  
two, platforms anyway.

-bob

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