473,834 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nice garbage collector for C extensions!

In the Python documentation on Extending and Embedding (in section
1.10), there's a quote:

"Maybe some day a sufficiently portable automatic garbage collector
will be available for C. Until then, we'll have to live with reference
counts."

What about the Boehm-Demers-Weiser conservative garbage collector (at
http://www.hpl.hp.com/personal/Hans_Boehm/gc/)?

They state, "The collector is not completely portable, but the
distribution includes ports to most standard PC and UNIX/Linux
platforms. The collector should work on Linux, *BSD, recent Windows
versions, MacOS X, HP/UX, Solaris, Tru64, Irix and a few other
operating systems. Some ports are more polished than others."

That's not bad! :)

The license also looks good, and it states, "Both space and time
overhead are likely to be only slightly higher for programs written
for malloc/free."

--Nick
Jul 18 '05 #1
9 1472
I think it had been done in the
1.5 or 1.4 days....
I therefore assume it did not
work quite as advertised.
Probably memory consumption is
much higher and less deterministic
than with reference counting.
PLT scheme seems to use this
garbage collector and it
consumes 40-50 MB, but including
GUI with editing and interactive
shell.

Maybe someone else who knows more
about this topic can comment or
give reference

ciao,
Dominic
Jul 18 '05 #2
ni***********@y ahoo.com (Nick Jacobson) writes:
In the Python documentation on Extending and Embedding (in section
1.10), there's a quote:

"Maybe some day a sufficiently portable automatic garbage collector
will be available for C. Until then, we'll have to live with reference
counts."

What about the Boehm-Demers-Weiser conservative garbage collector (at
http://www.hpl.hp.com/personal/Hans_Boehm/gc/)?
It's been tried, with unspectacular results. Google can probably find
more gory details.
They state, "The collector is not completely portable, but the
distribution includes ports to most standard PC and UNIX/Linux
platforms. The collector should work on Linux, *BSD, recent Windows
versions, MacOS X, HP/UX, Solaris, Tru64, Irix and a few other
operating systems. Some ports are more polished than others."


Python has been ported to the Palm Pilot, Nokia Series 60, VMS,
Amiga...

Cheers,
mwh

--
Hmm, that attempt at trolling did not work out as well as I had
hoped. -- Steve VanDevender, asr
Jul 18 '05 #3
> >
What about the Boehm-Demers-Weiser conservative garbage collector (at
http://www.hpl.hp.com/personal/Hans_Boehm/gc/)?
It's been tried, with unspectacular results.


What's been tried? I was suggesting using this garbage collector to
avoid the need for reference counting when writing C extensions. Has
that been tried? And if so, what do you mean by "unspectacular" ?
Google can probably find
more gory details.


Searching Google for what exactly? :P
They state, "The collector is not completely portable, but the
distribution includes ports to most standard PC and UNIX/Linux
platforms. The collector should work on Linux, *BSD, recent Windows
versions, MacOS X, HP/UX, Solaris, Tru64, Irix and a few other
operating systems. Some ports are more polished than others."


Python has been ported to the Palm Pilot, Nokia Series 60, VMS,
Amiga...

Cheers,
mwh


That's true. But the need for a few more ports shouldn't sink the
idea completely..

Thanks for the reply,

--Nick
Jul 18 '05 #4
[Nick Jacobson]
What about the Boehm-Demers-Weiser conservative garbage collector (at
http://www.hpl.hp.com/personal/Hans_Boehm/gc/)?

[Michael Hudson] It's been tried, with unspectacular results.
[Nick]
What's been tried?
Using BDW with Python, by several people over a span of years.
I was suggesting using this garbage collector to avoid the need for reference
counting when writing C extensions. Has that been tried?
Right.
And if so, what do you mean by "unspectacular" ?
Crashes and slowdowns.
Google can probably find more gory details.

Searching Google for what exactly? :P


Start with

Python Boehm
Jul 18 '05 #5
Tim Peters <ti********@gma il.com> writes:
[Nick Jacobson]
[...] what do you mean by "unspectacular" ?


Crashes and slowdowns.


Sounds spectacular to me :-)
Jul 18 '05 #6
Tim Peters <ti********@gma il.com> writes:
[Nick Jacobson]
What about the Boehm-Demers-Weiser conservative garbage collector (at
http://www.hpl.hp.com/personal/Hans_Boehm/gc/)?
[Michael Hudson] It's been tried, with unspectacular results.


[Nick]
What's been tried?


Using BDW with Python, by several people over a span of years.
I was suggesting using this garbage collector to avoid the need for reference
counting when writing C extensions. Has that been tried?


Right.
And if so, what do you mean by "unspectacular" ?


Crashes and slowdowns.


Were there crashes? I don't remember that bit...

Cheers,
mwh

--
(ps: don't feed the lawyers: they just lose their fear of humans)
-- Peter Wood, comp.lang.lisp
Jul 18 '05 #7
On Wed, Jul 21, 2004 at 01:03:32PM +0000, Michael Hudson wrote:
Were there crashes? I don't remember that bit...


If the GC cannot find all roots then it will free memory that's
still used. I think the _tkinter module had some problems and
perhaps readline as well.

Neil
Jul 18 '05 #8
[mwh, on using BDW in Python]
Were there crashes? I don't remember that bit...


That came out of the best-analyzed attempt to use BDW in Python (Neil
Schemenauer's, about 5 years ago). Long thread starting here:

http://mail.python.org/pipermail/pyt...ly/007623.html
Jul 18 '05 #9
Tim Peters <ti********@gma il.com> writes:
[mwh, on using BDW in Python]
Were there crashes? I don't remember that bit...


That came out of the best-analyzed attempt to use BDW in Python (Neil
Schemenauer's, about 5 years ago). Long thread starting here:

http://mail.python.org/pipermail/pyt...ly/007623.html


Oh right. They seem to have been fixed without too much pain, though.

Interesting thread, from a historical perspective...

Cheers.
mwh

--
<mitiege> dash: where do you go to school?
<tpck> mitiege: PSU
<mitiege> tpck: didn't faassen go there too?
-- from Twisted.Quotes
Jul 18 '05 #10

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

Similar topics

10
2058
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?
34
6442
by: Ville Voipio | last post by:
I would need to make some high-reliability software running on Linux in an embedded system. Performance (or lack of it) is not an issue, reliability is. The piece of software is rather simple, probably a few hundred lines of code in Python. There is a need to interact with network using the socket module, and then probably a need to do something hardware- related which will get its own driver written in C.
8
1788
by: HalcyonWild | last post by:
Hi, I installed the free version(command line only) of the digital mars c++ compiler. It said it features a garbage collection mechanism, but there was no documentation. I figured out that you have to extend the class mentioned in gc.h file. But it does not compile. Does the compiler automatically extend the gc classes, while compiling.
13
3823
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
3196
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
6883
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
1802
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...
46
2200
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?
158
7929
by: pushpakulkar | last post by:
Hi all, Is garbage collection possible in C++. It doesn't come as part of language support. Is there any specific reason for the same due to the way the language is designed. Or it is discouraged due to some specific reason. If someone can give inputs on the same, it will be of great help. Regards, Pushpa
0
9799
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
9649
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
10515
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10224
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
9338
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
7761
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
6960
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
5799
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3985
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.