Exemplo n.º 1
0
 public void SaveIndex()
 {
     //_log.Debug("Total split time (s) = " + _totalsplits);
     //_log.Debug("Total pages = " + _pageList.Count);
     int[] keys = _cache.Keys();
     Array.Sort(keys);
     // save index to disk
     foreach (var i in keys)
     {
         var p = _cache.GetValue(i);
         if (p.isDirty)
         {
             _index.SavePage(p);
             p.isDirty = false;
         }
     }
     _index.SavePageList(_pageList, _pageListDiskPages);
     _index.BitmapFlush();
 }
Exemplo n.º 2
0
 internal void FreeMemory()
 {
     try
     {
         List <int> free = new List <int>();
         foreach (var k in _cache.Keys())
         {
             var val = _cache.GetValue(k);
             if (val.isDirty == false)
             {
                 free.Add(k);
             }
         }
         log.Info("releasing bmp count = " + free.Count + " out of " + _cache.Count());
         foreach (int i in free)
         {
             _cache.Remove(i);
         }
     }
     catch (Exception ex) {
         log.Error(ex);
     }
 }