473,671 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

generational garbage collection

hello ppl,
i am trying to implement a garbage collector for c++ using the
generational algorithm applying mark-sweep to each generation.
i am unable to get any details about the algorithm. is it
necessary that the object allocated in each generation and the
generations themselves be in the form of contigious memory locations.

Aug 25 '05 #1
14 2152
Could you please tell us whether you are referring to managed C++(.NET)
or unmanaged C++? Thank you.

Aug 25 '05 #2

"Arvind" <ar****@yahoo.c o.in> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
hello ppl,
i am trying to implement a garbage collector for c++ using the
generational algorithm applying mark-sweep to each generation.
i am unable to get any details about the algorithm. is it
necessary that the object allocated in each generation and the
generations themselves be in the form of contigious memory locations.


Looking into my crystal ball (www.google.com) immediately gives me the
following things you might consider interesting:

http://www.hpl.hp.com/personal/Hans_Boehm/gc/
http://en.wikipedia.org/wiki/Automat...age_collection

HTH
chris
Aug 25 '05 #3
Chris, Arvind is a renowed a computer science processor. He may already
know about the links you found, I think Arvind is looking for people
who have actually worked on C++ garbage collection in academia or
industry(i.e. MSFT). Thank you.

Aug 25 '05 #4

"Frank Chang" <Fr**********@g mail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Chris, Arvind is a renowed a computer science processor. He may already
know about the links you found, I think Arvind is looking for people
who have actually worked on C++ garbage collection in academia or
industry(i.e. MSFT). Thank you.


Frank,

I acknowledge that Arvind is a renowned computer science expert in the field
of graph theory, quantum computing etc. However, he stated " i am unable to
get any details about the algorithm" which indicates that he has not found
the links. IMHO the forum might not be the best place to discuss a rather
intricate topic like garbage collection to the required detail. Therefore I
posted the links, which describe algorithms in detail to help him getting
started.

Cheers
Chris
Aug 25 '05 #5

Arvind schreef:
hello ppl,
i am trying to implement a garbage collector for c++ using the
generational algorithm applying mark-sweep to each generation.
i am unable to get any details about the algorithm. is it
necessary that the object allocated in each generation and the
generations themselves be in the form of contigious memory locations.


It seems to me the answer is obviously no. Why should it be? The usual
reason for a set of items to be contiguous is so one can easily find
a next item. Exactly how you define 'next' also defines 'contiguous'.
If you don't qualify it, you usually refer to the "natural" order, i.e.
increasing addresses.

So, in this context I assume you'd want to have a contiguous memory
block so you can find the next allocation. However, if the memory
allocator used a linked list, the physical representation would
probably be non-contiguous, but one could still find the next
allocation in the generation.

HTH,
Michiel Salters

Aug 25 '05 #6

"Arvind" <ar****@yahoo.c o.in> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
hello ppl,
i am trying to implement a garbage collector for c++ using the
generational algorithm applying mark-sweep to each generation.
i am unable to get any details about the algorithm. is it
necessary that the object allocated in each generation and the
generations themselves be in the form of contigious memory locations.


For mark-sweep GC contiguous memory is not required. However, you might end
up with heavily fragmented memory (depending on your application) and this
could lead to slower reallocation. There are other approaches that
inherently move allocated objects and therefore will automatically result in
contiguous memory. I'd recommend to take a look at
http://www.iecc.com/gclist/GC-faq.html

HTH
Chris
Aug 25 '05 #7
Chris, I apologize. You are right. It seems you know a lot about
garbage collection. Was this experience gained through industry or
school? Thank you.

Aug 25 '05 #8
Chris Theis, I have two reservations about garbage collection in C++ .
The first set of reservations can be found in the link ,
http://www.cs.tut.fi/~warp/MicrosoftComparingLanguages.
The second reservation that the GC-LIST link does not address is the
issue of multiple threads running in a C++ program. How will GC-LIST
handle the memory allocated to each worker thread that is instantianted
when the worker threads finish their tasks? Thank you.

Aug 25 '05 #9

"Frank Chang" <Fr**********@g mail.com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
Chris Theis, I have two reservations about garbage collection in C++ .
The first set of reservations can be found in the link ,
http://www.cs.tut.fi/~warp/MicrosoftComparingLanguages.
The second reservation that the GC-LIST link does not address is the
issue of multiple threads running in a C++ program. How will GC-LIST
handle the memory allocated to each worker thread that is instantianted
when the worker threads finish their tasks? Thank you.


Dear Frank,

frankly I share your reservations about GC starting already at the
philosophical design point of view, which is followed by the technical
requirements and overhead that can become very tricky. This is especially
true for multi threading environments. There are different approaches for
this problem like for example safe-points. This means that all threads must
have reached a safe-point before the GC can start its work. However, this
might become a bottleneck as soon as threads with very different priority
levels are involved as it could cause serious delays. Other approaches
include breaking the problem down into single-thread contexts, etc.

You might probably take a look at the following page which hosts a fairly
large collection of papers covering GC thread problems etc.

http://research.sun.com/jtech/pubs/
http://www-128.ibm.com/developerwork...ry/i-garbage2/

HTH
Chris
Aug 26 '05 #10

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

Similar topics

0
1489
by: Marc Lehmann | last post by:
Hello Group, I'm working on a seminar talk about generational garbage collection in the Java HotSpot enginge. Now most things are quite clear to me, but there's a question I didn't find an answer yet: On a minor collection, how can I move Objects, say from Eden to SS#1, without touching the old generation? What if an object from the old generation refers to one in Eden? I mean, when at the same time they stop using handles for object...
6
810
by: Ganesh | last post by:
Is there a utility by microsoft (or anyone) to force garbage collection in a process without have access to the process code. regards Ganesh
11
2723
by: Rick | last post by:
Hi, My question is.. if Lisp, a 40 year old language supports garbage collection, why didn't the authors of C++ choose garbage collection for this language? Are there fundamental reasons behind this? Is it because C is generally a 'low level' language and they didn't want garbage collection to creep into C++ and ruin everything? Just wondering :)
5
3594
by: Bob lazarchik | last post by:
Hello: We are considering developing a time critical system in C#. Our tool used in Semiconductor production and we need to be able to take meaurements at precise 10.0 ms intervals( 1000 measurement exactly 10 ms apart. In the future this may decrease to 5ms ). I am concerned that if garbage collection invokes during this time it may interfere with our measurement results. I have looked over the garbage collection mechanism and see no...
8
3034
by: mike2036 | last post by:
For some reason it appears that garbage collection is releasing an object that I'm still using. The object is declared in a module and instantiated within a class that is in turn instantiated by the mainline. The class that instantiated the object in question is definitely still in existence at the point garbage collection swoops in and yanks it out from under my processing. Is there a way to ensure an instantiated object cannot be freed...
28
3167
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...
56
3673
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()
350
11711
by: Lloyd Bonafide | last post by:
I followed a link to James Kanze's web site in another thread and was surprised to read this comment by a link to a GC: "I can't imagine writing C++ without it" How many of you c.l.c++'ers use one, and in what percentage of your projects is one used? I have never used one in personal or professional C++ programming. Am I a holdover to days gone by?
158
7803
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
8390
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
8909
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
8819
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...
1
6222
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
5690
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
4399
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2806
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
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1801
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.