public RuntimeBase(ClrInfo info, DataTargetImpl dataTarget, DacLibrary lib)
        {
            Debug.Assert(lib != null);
            Debug.Assert(lib.DacInterface != null);

            ClrInfo       = info;
            _dataTarget   = dataTarget;
            _library      = lib;
            _dacInterface = _library.DacInterface;
            InitApi();

            _dacInterface.Flush();

            IGCInfo data = GetGCInfo();

            if (data == null)
            {
                throw new ClrDiagnosticsException("This runtime is not initialized and contains no data.", ClrDiagnosticsException.HR.RuntimeUninitialized);
            }

            ServerGC    = data.ServerMode;
            HeapCount   = data.HeapCount;
            CanWalkHeap = data.GCStructuresValid && !dataTarget.DataReader.IsMinidump;
            _dataReader = dataTarget.DataReader;
        }
Exemple #2
0
        public void UpdateCollectionInfo()
        {
            Count = new GCInfoInstance(
                GC.CollectionCount(0) - InitialValues.Gen0,
                GC.CollectionCount(1) - InitialValues.Gen1,
                GC.CollectionCount(2) - InitialValues.Gen2);

            _collected = true;
        }
Exemple #3
0
        internal override IGCInfo GetGCInfo()
        {
            IGCInfo data = GetGCInfoImpl();

            if (data == null)
            {
                throw new ClrDiagnosticsException("This runtime is not initialized and contains no data.", ClrDiagnosticsException.HR.RuntimeUninitialized);
            }

            return(data);
        }
Exemple #4
0
        public RuntimeBase(ClrInfo info, DataTargetImpl dataTarget, DacLibrary lib)
        {
            Debug.Assert(lib != null);
            Debug.Assert(lib.DacInterface != null);

            ClrInfo       = info;
            _dataTarget   = dataTarget;
            _library      = lib;
            _dacInterface = _library.DacInterface;
            InitApi();

            _dacInterface.Flush();

            IGCInfo data = GetGCInfo();

            if (data != null)
            {
                ServerGC    = data.ServerMode;
                HeapCount   = data.HeapCount;
                CanWalkHeap = data.GCStructuresValid;
            }
            _dataReader = dataTarget.DataReader;
        }