IGCHost Interface

Provides methods for obtaining information about the garbage collection system and for controlling some aspects of garbage collection.

NoteNote:

This interface is for expert usage only. It can affect the performance of an application if used improperly.

interface IGCHost : IUnknown {

    HRESULT SetGCStartupLimits(
        [in] DWORD SegmentSize, 
        [in] DWORD MaxGen0Size
    );
    HRESULT Collect(
        [in] LONG Generation
    );
    HRESULT GetStats(
        [in, out] COR_GC_STATS *pStats
    );
    HRESULT GetThreadStats(
        [in] DWORD *pFiberCookie,
        [in, out] COR_GC_THREAD_STATS *pStats
    );
    HRESULT SetVirtualMemLimit (
        [in] SIZE_T sztMaxVirtualMemMB
    );
}

Methods

Method

Description

IGCHost::Collect Method

Forces a collection to occur for the given generation, regardless of the state of the current garbage collection.

IGCHost::GetStats Method

Gets the statistics for the current state of the garbage collection system.

IGCHost::GetThreadStats Method

Gets the per-thread statistics for garbage collection.

IGCHost::SetGCStartupLimits Method

Sets the segment size and the maximum size for generation 0.

IGCHost::SetVirtualMemLimit Method

Sets the maximum size of the runtime's virtual memory.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: GCHost.idl

Library: Included as a resource in MSCorEE.dll

.NET Framework Version: 2.0

See Also

Concepts

Hosting Interfaces