From e6863c29fada8169420f6fd7f280c05ef171098e Mon Sep 17 00:00:00 2001 From: danmosemsft Date: Mon, 23 Jan 2017 09:03:41 -0800 Subject: Disable and remove FEATURE_APPDOMAIN_RESOURCE_MONITORING. This is a behavior change --- clr.coreclr.props | 1 - clr.defines.targets | 2 - clr.desktop.props | 1 - src/mscorlib/model.xml | 11 ---- src/mscorlib/src/System/AppDomain.cs | 106 ----------------------------------- 5 files changed, 121 deletions(-) diff --git a/clr.coreclr.props b/clr.coreclr.props index 8862ed0763..ed5dd1a2ec 100644 --- a/clr.coreclr.props +++ b/clr.coreclr.props @@ -5,7 +5,6 @@ true true true - true true true true diff --git a/clr.defines.targets b/clr.defines.targets index 7a6ff9f249..74b815f8db 100644 --- a/clr.defines.targets +++ b/clr.defines.targets @@ -4,7 +4,6 @@ $(CDefines);DEBUGGING_SUPPORTED $(CDefines);EnC_SUPPORTED $(CDefines);ENABLE_DOWNLEVEL_FOR_NLS - $(CDefines);FEATURE_APPDOMAIN_RESOURCE_MONITORING $(CDefines);FEATURE_APPDOMAINMANAGER_INITOPTIONS $(CDefines);FEATURE_APPX $(CDefines);FEATURE_APPX_BINDER @@ -111,7 +110,6 @@ $(DefineConstants);BUILDTYPE_RET $(DefineConstants);FEATURE_APPDOMAINMANAGER_INITOPTIONS - $(DefineConstants);FEATURE_APPDOMAIN_RESOURCE_MONITORING $(DefineConstants);FEATURE_APPX $(DefineConstants);FEATURE_APPX_BINDER $(DefineConstants);FEATURE_APTCA diff --git a/clr.desktop.props b/clr.desktop.props index de3f0634a6..d3768a8a64 100644 --- a/clr.desktop.props +++ b/clr.desktop.props @@ -4,7 +4,6 @@ true true true - true true true true diff --git a/src/mscorlib/model.xml b/src/mscorlib/model.xml index c68b4114a2..a1673c37b3 100644 --- a/src/mscorlib/model.xml +++ b/src/mscorlib/model.xml @@ -87,17 +87,6 @@ - - - - - - - - - - - diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs index 8d1e3cb5a9..84104563c5 100644 --- a/src/mscorlib/src/System/AppDomain.cs +++ b/src/mscorlib/src/System/AppDomain.cs @@ -1561,112 +1561,6 @@ namespace System [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] internal extern Int32 GetId(); -#if FEATURE_APPDOMAIN_RESOURCE_MONITORING - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern void nEnableMonitoring(); - - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern bool nMonitoringIsEnabled(); - - // return -1 if ARM is not supported. - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern Int64 nGetTotalProcessorTime(); - - // return -1 if ARM is not supported. - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern Int64 nGetTotalAllocatedMemorySize(); - - // return -1 if ARM is not supported. - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern Int64 nGetLastSurvivedMemorySize(); - - // return -1 if ARM is not supported. - [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static extern Int64 nGetLastSurvivedProcessMemorySize(); - - public static bool MonitoringIsEnabled - { - get { - return nMonitoringIsEnabled(); - } - - set { - if (value == false) - { - throw new ArgumentException(Environment.GetResourceString("Arg_MustBeTrue")); - } - else - { - nEnableMonitoring(); - } - } - } - - // Gets the total processor time for this AppDomain. - // Throws NotSupportedException if ARM is not enabled. - public TimeSpan MonitoringTotalProcessorTime - { - get { - Int64 i64ProcessorTime = nGetTotalProcessorTime(); - if (i64ProcessorTime == -1) - { - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WithoutARM")); - } - return new TimeSpan(i64ProcessorTime); - } - } - - // Gets the number of bytes allocated in this AppDomain since - // the AppDomain was created. - // Throws NotSupportedException if ARM is not enabled. - public Int64 MonitoringTotalAllocatedMemorySize - { - get { - Int64 i64AllocatedMemory = nGetTotalAllocatedMemorySize(); - if (i64AllocatedMemory == -1) - { - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WithoutARM")); - } - return i64AllocatedMemory; - } - } - - // Gets the number of bytes survived after the last collection - // that are known to be held by this AppDomain. After a full - // collection this number is accurate and complete. After an - // ephemeral collection this number is potentially incomplete. - // Throws NotSupportedException if ARM is not enabled. - public Int64 MonitoringSurvivedMemorySize - { - get { - Int64 i64LastSurvivedMemory = nGetLastSurvivedMemorySize(); - if (i64LastSurvivedMemory == -1) - { - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WithoutARM")); - } - return i64LastSurvivedMemory; - } - } - - // Gets the total bytes survived from the last collection. After - // a full collection this number represents the number of the bytes - // being held live in managed heaps. (This number should be close - // to the number obtained from GC.GetTotalMemory for a full collection.) - // After an ephemeral collection this number represents the number - // of bytes being held live in ephemeral generations. - // Throws NotSupportedException if ARM is not enabled. - public static Int64 MonitoringSurvivedProcessMemorySize - { - get { - Int64 i64LastSurvivedProcessMemory = nGetLastSurvivedProcessMemorySize(); - if (i64LastSurvivedProcessMemory == -1) - { - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WithoutARM")); - } - return i64LastSurvivedProcessMemory; - } - } -#endif } /// -- cgit v1.2.3