ICLRAppDomainResourceMonitor::GetCurrentSurvived Method
Gets the number of bytes that survived the last full, blocking garbage collection and that are referenced by the current application domain.
HRESULT STDMETHODCALLTYPE GetCurrentSurvived(
[in] DWORD dwAppDomainId,
[out] ULONGLONG *pAppDomainBytesSurvived,
[out] ULONGLONG *pTotalBytesSurvived);
Parameters
dwAppDomainId
[in] The ID of the requested application domain.pAppDomainBytesSurvived
[out] A pointer to the number of bytes that survived after the last garbage collection that are held by this application domain. After a full collection, this number is accurate and complete. After an ephemeral collection, this number is potentially incomplete. This parameter can be null.pRuntimeBytesSurvived
[out] A pointer to the total number of bytes that survived from the last garbage collection. After a full collection, this number represents the number of the bytes that are held in managed heaps. After an ephemeral collection, this number represents the number of bytes that are held live in ephemeral generations. This parameter can be null.
Return Value
This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure.
HRESULT |
Description |
---|---|
S_OK |
The method completed successfully. |
COR_E_APPDOMAINUNLOADED |
The application domain has been unloaded or does not exist. |
Remarks
Statistics are updated only after a full, blocking garbage collection; that is, a collection that includes all generations and that stops the application while collection occurs. For example, the GC.Collect() method overload performs a full, blocking collection. Concurrent garbage collection occurs in the background and does not block the application.
The GetCurrentSurvived method is the unmanaged equivalent of the managed AppDomain.MonitoringSurvivedMemorySize property.
Requirements
Platforms: See .NET Framework System Requirements.
Header: MetaHost.h
Library: Included as a resource in MSCorEE.dll
.NET Framework Versions: 4
See Also
Reference
ICLRAppDomainResourceMonitor Interface
Concepts
Application Domain Resource Monitoring