473,804 Members | 3,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: garbage collector and slowdown (guillaume weymeskirch)


guillaumeBut I've noticed a near linear slowdown of the execution :
guillaumeafter a few minutes - and several millions of allocated and
guillaumefreed objects, each iteration take more and more time to
guillaumeexecut e.

I ran your script on my Mac and let it go for over an hour. The times
printed near the end were not that different than the times near the start.

First few prints:

4.80848908424
4.17986106873
4.07436394691
4.57266497612
4.26531600952
4.1674759388
4.00401592255
4.56974005699
4.33465600014
4.17652106285
4.02282094955
4.6344628334

Last few prints:

4.0330889225
3.89743900299
4.39918708801
4.16099500656
4.06551003456
3.91927599907
4.42701005936
4.17856502533
4.07650518417
3.93242192268
4.44240498543
4.32765197754

Final summary:

{'ClassicBig': 29580000, 'ClassicSmall': 29580000, 'Tree': 29580000}
max=5.617558 min=3.869602

This was with Python 2.6. I then ran it for awhile (though not nearly as
long - just 5-10 minutes) with Python 2.5.

First few prints:

4.50398087502
3.73511385918
3.63765382767
4.04779291153
3.87206196785
3.73774003983
3.62571001053
4.02851200104
3.90740704536
3.87872505188
3.71122288704
4.11415696144
3.95573282242

Last few prints:

5.18314695358
5.6188788414
5.40970396996
5.31133294106
5.14807605743
5.70623922348
5.47632288933
5.46225881577
5.42709779739
5.80780506134
5.53798508644
5.43349313736
5.5712749958
5.91922187805

Summary:

{'ClassicBig': 5101922, 'ClassicSmall': 5101922, 'Tree': 5101922}
max=6.006355 min=3.625710

It seems that whatever problem you saw in 2.5 is fixed in 2.6.

Skip
Oct 4 '08 #1
0 1250

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2056
by: pachanga | last post by:
The Hans-Boehm garbage collector can be successfully used with C and C++, but not yet a standard for C++.. Is there talks about Garbage Collector to become in the C++ standard?
13
3818
by: Mingnan G. | last post by:
Hello everyone. I have written a garbage collector for standard C++ application. It has following main features. 1) Deterministic Finalization Providing deterministic finalization, the system can manage resources as well as objects. The programming style is clear and easy, conforming to RAII (Resource Acquisition Is Initialization) idiom of C++ programmers. The memory usage is very efficient, acyclic garbage is
28
3191
by: Goalie_Ca | last post by:
I have been reading (or at least googling) about the potential addition of optional garbage collection to C++0x. There are numerous myths and whatnot with very little detailed information. Will this work be library based or language based and will it be based on that of managed C++? Then of course there are the finer technical questions raised (especially due to pointer abuse). Is a GC for C++ just a pipe dream or is there a lot of work...
142
6873
by: jacob navia | last post by:
Abstract -------- Garbage collection is a method of managing memory by using a "collector" library. Periodically, or triggered by an allocation request, the collector looks for unused memory chunks and recycles them. This memory allocation strategy has been adapted to C (and C++) by the library written by Hans J Boehm and Alan J Demers. Why a Garbage Collector? -----------------------
8
1794
by: Paul.Lee.1971 | last post by:
Hi everyone, A program that I'm helping to code seems to slow down drastically during initialisation, and looking at the profiling graph, it seems to be the garbage collector thats slowing things down. I must point out that a heck of a lot of data are being read in and manipulated, and I was wondering if there were any metrics to show much of a performance hit is occurring during the initialisation? If it turns out that the GC is having a...
56
3720
by: Johnny E. Jensen | last post by:
Hellow I'am not sure what to think about the Garbage Collector. I have a Class OutlookObject, It have two private variables. Private Microsoft.Office.Interop.Outlook.Application _Application = null; Private Microsoft.Office.Interop.Outlook.NameSpace _Namespace = null; The Constructor: public OutlookObject()
4
2062
by: Carl Banks | last post by:
On Apr 12, 7:02 am, andreas.eis...@gmail.com wrote: Well, the garbage collector activates whenever allocations exceed deallocations by a certain amount, which for obvious reasons is the reason for the bottleneck wh My first stab at a suggestion would be to adjust the threshold depending on how successful it is. So if a garbage collection run collects no objects, double (or whatever) the threshold until the next run.
46
2195
by: Carlo Milanesi | last post by:
Hello, traditionally, in C++, dynamically allocated memory has been managed explicitly by calling "delete" in the application code. Now, in addition to the standard library strings, containers, and auto_ptrs, gurus suggest that may be better to use a reference-counted smart pointer, or a garbage-collector. But in which cases it is better to use one technique and in which cases another? IOW, which is the design criterion?
0
885
by: guillaume weymeskirch | last post by:
Hello everybody, To test the python 2.5 garbage collector, I wrote a trivial script allocating dummy objects of various sizes, then forgetting them in a loop. The garbage collector seems working well, limiting the memory used. But I've noticed a near linear slowdown of the execution : after a few minutes - and several millions of allocated and freed objects, each iteration take more and more time to execute.
1
196
by: Terry Reedy | last post by:
guillaume weymeskirch wrote: On a related note, there have been past threads reporting that allocating and freeing increasingly long arrays, especially of tuples (as I remember) can take more than linearly increasing time. The solution was to turn off gc during the allocation phase so it did not get triggered and spend increasing long times searching for collectible objects when there were not any.
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9569
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10558
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9130
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.