473,503 Members | 3,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Static Memory Area for Garbage Collection

Hi,

I am in the process of designing a conservative garbage collector for C
++.

As one of the requirement of conservative garbage collection, I will
have to scan through the static memory area and look for probable
pointers into the heap.

I am stuck in the implementation part, where I am not very sure on
which physical address the static elements are stored for X86
machines. Is the address of the static area stored in some processor
register? If yes how can I access it in a C++ program?

Thanks!

Oct 30 '07 #1
3 1533
R Karthick wrote:
I am in the process of designing a conservative garbage collector for
C ++.

As one of the requirement of conservative garbage collection, I will
have to scan through the static memory area and look for probable
pointers into the heap.

I am stuck in the implementation part, where I am not very sure on
which physical address the static elements are stored for X86
machines. Is the address of the static area stored in some processor
register? If yes how can I access it in a C++ program?
The boilerplate answer is "you cannot". C++ has no concept of "X86".
It has no concept of accessible (for scanning) "static memory area".
All of those things are compiler- and platform-specific and should be
asked about in the newsgroup specialising in your particular platform
and compiler.

There are several commercial implementations of garbage-collecting
memory managers on the market. Perhaps you should give those a look.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 30 '07 #2
Victor Bazarov wrote:
There are several commercial implementations of garbage-collecting
memory managers on the market. Perhaps you should give those a look.
Just for completeness, there's also the free Boehm GC, which claims
(some) support for C++. I've never tried it myself, though.

http://www.hpl.hp.com/personal/Hans_Boehm/gc/
Nov 30 '07 #3
On Nov 30, 4:51 pm, Matthias Buelow <m...@incubus.dewrote:
Victor Bazarov wrote:
There are several commercial implementations of garbage-collecting
memory managers on the market. Perhaps you should give those a look.
Just for completeness, there's also the free Boehm GC, which claims
(some) support for C++. I've never tried it myself, though.
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
Actually, it has very good support for C++. I've used it, at
least with g++ under Linux, and it works quite well.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Nov 30 '07 #4

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

Similar topics

0
2026
by: Andreas Suurkuusk | last post by:
Hi, I just noticed your post in the "C# memory problem: no end for our problem?" thread. In the post you implied that I do not how the garbage collector works and that I mislead people. Since...
9
2413
by: CptDondo | last post by:
I am working on an embedded platform which has a block of battery-backed RAM. I need to store various types of data in this block of memory - for example, bitmapped data for control registers,...
1
2793
by: Chris Bardon | last post by:
I'm working on a class library in .net, and am having a problem that I can only describe as a memory leak (which garbage collection was supposed to eliminate). My class library contains a single...
4
1792
by: Rick | last post by:
Hello, Below I create a static instance of an object, works well. public static BasicCounter GlobalCounter = new BasicCounter("GlobalCounter"); private void Page_Load(object sender,...
8
8519
by: Adrian | last post by:
Hi I have a JS program that runs localy (under IE6 only) on a PC but it has a memory leak (probably the known MS one!) What applications are there that I could use to look at the memory usage of...
9
20536
by: Chuck Cobb | last post by:
I am creating some static classes with static methods and static variables, but I have a question: What is the lifetime of static classes and static variables? Is there any risk that these...
81
4477
by: Peter Olcott | last post by:
It looks like System::Collections::Generic.List throws and OUT_OF_MEMORY exception whenever memory allocated exceeds 256 MB. I have 1024 MB on my system so I am not even out of physical RAM, much...
12
501
by: Nehil | last post by:
can i find about following 2 things, by providing my own API of functions for a C program : 1) static, global and const section of variables (pointers only), and to pickout only those which are...
2
1015
by: Jack Jackson | last post by:
On Wed, 11 Jun 2008 07:32:30 +0200, "Fred" <foleide@free.fr.invalid> wrote: If the control will soon be eligible for garbage collection, then no. If the control won't be eligible for garbage...
0
7188
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,...
0
7063
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...
0
7258
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,...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7441
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...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1489
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 ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
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...

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.