This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy



Download 21,46 Mb.
Pdf ko'rish
bet511/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   507   508   509   510   511   512   513   514   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

Understanding Object Generations

When the CLR is attempting to locate unreachable objects, is does not literally examine each and

every object placed on the managed heap. Obviously, doing so would involve considerable time,

especially in larger (i.e., real-world) applications.

To help optimize the process, each object on the heap is assigned to a specific “generation.”

The idea behind generations is simple: the longer an object has existed on the heap, the more likely

it is to stay there. For example, the object implementing Main() will be in memory until the program

terminates. Conversely, objects that have been recently placed on the heap (such as an object allo-

cated within a method scope) are likely to be unreachable rather quickly. Given these assumptions,

each object on the heap belongs to one of the following generations:



Generation 0: Identifies a newly allocated object that has never been marked for collection



Generation 1: Identifies an object that has survived a garbage collection (i.e., it was marked

for collection, but was not removed due to the fact that the sufficient heap space was

acquired)

• Generation 2: Identifies an object that has survived more than one sweep of the garbage

collector

The garbage collector will investigate all generation 0 objects first. If marking and sweeping

these objects results in the required amount of free memory, any surviving objects are promoted

to generation 1. To illustrate how an object’s generation affects the collection process, ponder

Figure 8-5, which diagrams how a set of surviving generation 0 objects (A, B, and E) are promoted

once the required memory has been reclaimed.


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   507   508   509   510   511   512   513   514   ...   1830




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish