public void RegisterProxyAndStart(RecycleLimitMonitor proxy, string applicationID) { if (proxy != null && !String.IsNullOrWhiteSpace(applicationID)) { lock (this) { _proxyMonitors.Add(proxy, applicationID); StartTimer(); } } }
internal AspNetMemoryMonitor() { _recycleMonitor = new RecycleLimitMonitor(); DefaultRecycleLimitObserver = new RecycleLimitObserver(); _lowMemoryMonitor = new LowPhysicalMemoryMonitor(); DefaultLowPhysicalMemoryObserver = new LowPhysicalMemoryObserver(); if (_firstMemoryMonitor == null) { _firstMemoryMonitor = this; } }
public void UnregisterProxyAndStop(RecycleLimitMonitor proxy) { if (proxy != null) { lock (this) { _proxyMonitors.Remove(proxy); if (_proxyMonitors.Count == 0) { StopTimer(); } } } }