FreeMemory() 공개 메소드

public FreeMemory ( ) : void
리턴 void
예제 #1
0
        public void Commit(bool freeMemory)
        {
            if (_isDirty == false)
            {
                return;
            }
            using (new L(this))
            {
                log.Debug("writing " + _FileName);
                int[] keys = _cache.Keys();
                Array.Sort(keys);

                foreach (int k in keys)
                {
                    WAHBitArray bmp = null;
                    if (_cache.TryGetValue(k, out bmp) && bmp.isDirty)
                    {
                        SaveBitmap(k, bmp);
                        bmp.FreeMemory();
                        bmp.isDirty = false;
                    }
                }
                Flush();
                if (freeMemory)
                {
                    _cache = //new SafeDictionary<int, WAHBitArray>();
                             new SafeSortedList <int, WAHBitArray>();
                    log.Debug("  freeing cache");
                }
                _isDirty = false;
            }
        }
예제 #2
0
        public void Commit(bool freeMemory)
        {
            if (_isDirty == false)
            {
                return;
            }
            using (new L(this))
            {
                log.Debug("writing " + _FileName);
                int[] keys = _cache.Keys.OrderBy(x => x).ToArray();

                foreach (int k in keys)
                {
                    WAHBitArray bmp = null;
                    if (_cache.TryGetValue(k, out bmp) && bmp.isDirty)
                    {
                        SaveBitmap(k, bmp);
                        bmp.FreeMemory();
                        bmp.isDirty = false;
                    }
                }
                Flush();
                if (freeMemory)
                {
                    //if (Global.UseLessMemoryStructures)
                    //    _cache = new SafeSortedList<int, WAHBitArray>();
                    //else
                    _cache = new ConcurrentDictionary <int, WAHBitArray>();
                    log.Debug("  freeing cache");
                }
                _isDirty = false;
            }
        }
예제 #3
0
 public void FreeMemory()
 {
     lock (_lock)
     {
         SaveIndex();
         _bits.FreeMemory();
     }
 }
예제 #4
0
 public void FreeMemory()
 {
     lock (_lock)
     {
         SaveIndex();
         _bits.FreeMemory();
         // free memory
         //_bits.FreeMemory();
         // save to disk
         //SaveIndex();
     }
 }
예제 #5
0
 public void FreeMemory()
 {
     // free memory
     _bits.FreeMemory();
 }