473,378 Members | 1,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

gc : gen 0,1,2 heaps, loh

Are Gen 0, Gen 1, Gen 2 heaps and Large Object Heaps physically contiguous ?
Or are these abstract representations of groups of allocated segments in the
general heap ? More specifically, are the segments physically contiguous
within each heap ? And are the heaps physically contiguous ?

So, G1,G2,G3 heap max size, etc. (and LOH max size) are proportionate to the
# of general heap memory segments currently allocated for each of these GC
heaps ?

If the GC heaps are not physically contiguous memory spaces, by what method
does generational promotion reduce fragmention in the preceding heaps ? (
scenario 1 : a just de-referenced object is added to gen 1 heap; scenario
2: a gen 1 heap object is promoted to gen 2 heap )
Jun 22 '07 #1
2 3474
John Grandy wrote:
Are Gen 0, Gen 1, Gen 2 heaps and Large Object Heaps physically contiguous ?
Or are these abstract representations of groups of allocated segments in the
general heap ? More specifically, are the segments physically contiguous
within each heap ? And are the heaps physically contiguous ?
The generational heaps are certainly contigous. The idea is that
allocating memory is a very simple process, where the next free block is
always at the top of the heap.

The large objects heap is probably not contigous, as it expands when needed.
So, G1,G2,G3 heap max size, etc. (and LOH max size) are proportionate to the
# of general heap memory segments currently allocated for each of these GC
heaps ?

If the GC heaps are not physically contiguous memory spaces, by what method
does generational promotion reduce fragmention in the preceding heaps ? (
scenario 1 : a just de-referenced object is added to gen 1 heap; scenario
2: a gen 1 heap object is promoted to gen 2 heap )
The general method to avoid fragmentation is to move all used objects to
the next generation and wipe the current generation totally clean. As
memory only is allocated from the top of the heap, it's actually never
fragmented at all. It just contains used and unused objects, and only
the garbage collector knows and cares if the objects are used or not.

--
Göran Andersson
_____
http://www.guffa.com
Jun 23 '07 #2

"John Grandy" <johnagrandy-at-gmail-dot-comwrote in message
news:eY**************@TK2MSFTNGP02.phx.gbl...
Are Gen 0, Gen 1, Gen 2 heaps and Large Object Heaps physically contiguous
? Or are these abstract representations of groups of allocated segments in
the general heap ? More specifically, are the segments physically
contiguous within each heap ? And are the heaps physically contiguous ?
By "physically", do you really mean physically? You shouldn't care. .NET
runs only in user-mode which has only logical addresses. The only time the
physical addresses matter are on NUMA machines, and even then the ordering
within each node doesn't matter. RAM is "random-access", after all, you
gain nothing from allocating physical pages sequentially except smaller page
tables, and the only way to control that from user-space is to precommit
large blocks which is in general a very bad idea, especially for a
general-purpose platform like .NET.
Jun 25 '07 #3

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

Similar topics

0
by: aaronwmail-usenet | last post by:
I've been wondering about benchmarks recently. What is a fair benchmark? How should benchmarks be vetted or judged? I decided to see what you folks thought, so for discussion I compared two...
6
by: Sathyaish | last post by:
I've searched Google and found a few, but I am not so satisfied. Any good reading on "stacks and heaps" about how and when memory is allocated from the heap?
3
by: Jason Collins | last post by:
Win 2K3 Server; Framework 1.1 If I look at the asp.net process in perfmon, it reports 650,000,000 bytes for Memory:Private Bytes, yet .NET CLR Memory:# Bytes in all Heaps reports only 80,650,000...
1
by: Brian | last post by:
Is there a rule-of-thumb for a healthy ratio between these two counters? I think I have some memory leak problems on the run in my ASP.NET application but the difference between these counters...
3
by: Scott David Daniels | last post by:
I've just put together a Double-Ended Heap package. Of course I'd love comments. http://members.dsl-only.net/~daniels/deheap.html --Scott David Daniels scott.daniels@acm.org
5
by: le007 | last post by:
:) Hey All, I've recently tried my hand with CSS. I know a good bit of html and thats more or less it. I've moved back to Ireland from Australia now and I'm trying to put a site together to keep...
14
by: vivek | last post by:
i have some doubts on dynamic memory allocation and stacks and heaps where is the dynamic memory allocation used? in function calls there are some counters like "i" in the below function. Is...
3
by: abhishek | last post by:
Hi group any idea on HOW TO HANDLE POINTERS FROM NON-LOCAL HEAPS?? Thank you
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.