473,473 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

.NET Garbage Collector Question - Pinned Memory

..Net - All versions

I have Essential .Net Vol 1 (Don Box) and the Jeffrey Richter articles
on the .NET heap - they are both excellent reads. But I am still
unclear on the big pinned memory question:

Pinned memory: if I have a block of pinned memory active on the heap
when a garbage collection occurs where does the garbage collector set
the NextObj pointer? Can the garbage collector/heap allocator logic
work around the pinned block or does the pinned block become the new
top of the heap?

Please respond to this post only if you know the articles I mentioned
and/or know the answer to my question - I don't want people to think
that this post was answered unless it has actually been answered.
Thanx in advance for anybody's help that knows what I am fishing for :)

Jul 12 '07 #1
1 2325
If you think about it, it can't be after the pinned block, because what
if the pinned block takes up the last section of memory on the heap? You
would end up getting an OOM exception when in reality you have available
memory (which the CLR does not do). The GC HAS to work around the pinned
block.

Since the CLR has to work around the pinned objects, this can easily
lead to fragmentation of the heap. Maoni blogs about this here:

http://blogs.msdn.com/maoni/archive/...lr-2-0-gc.aspx

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Crash" <so*********@san.rr.comwrote in message
news:11*********************@r34g2000hsd.googlegro ups.com...
.Net - All versions

I have Essential .Net Vol 1 (Don Box) and the Jeffrey Richter articles
on the .NET heap - they are both excellent reads. But I am still
unclear on the big pinned memory question:

Pinned memory: if I have a block of pinned memory active on the heap
when a garbage collection occurs where does the garbage collector set
the NextObj pointer? Can the garbage collector/heap allocator logic
work around the pinned block or does the pinned block become the new
top of the heap?

Please respond to this post only if you know the articles I mentioned
and/or know the answer to my question - I don't want people to think
that this post was answered unless it has actually been answered.
Thanx in advance for anybody's help that knows what I am fishing for :)

Jul 12 '07 #2

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

Similar topics

4
by: Pedro Miguel Carvalho | last post by:
Greetings. I'm creating a project that as a intricate relation between object kind of like a set where each object in the set can be connect to a subset of object of the set and objects not in...
10
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?
3
by: Reinier VDW | last post by:
Hi, I am using a MIDI header structure MIDIHDR. The header contains a pointer lpData to a string sSysEx, which is filled by an API call back routine using that pointer. The structure, an...
18
by: Larry Herbinaux | last post by:
I'm having issues with garbage collection with my long-standing service process. If you could review and point me in the right direction it would be of great help. If there are any helpful...
13
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...
28
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...
142
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...
16
by: Atmapuri | last post by:
Hi! It would be great, if the pinned arrays would be garbage collectable. This would greatly reduce the amount of copy back and forth the managed and unmanaged memory. I cant think of a single...
46
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,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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,...
0
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...
1
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
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.