void freeMemory(){
  if (getTabCount() == 0)   return;
  Vector<Tab> tabs=getHalfLeastUsedTabs(getCurrentTab());
  if (tabs.size() > 0) {
    Log.w(LOGTAG,"Free " + tabs.size() + " tabs in the browser");
    for (    Tab t : tabs) {
      t.saveState();
      t.destroy();
    }
    return;
  }
  Log.w(LOGTAG,"Free WebView's unused memory and cache");
  WebView view=getCurrentWebView();
  if (view != null) {
    view.freeMemory();
  }
}

void freeMemory ( ) { if ( getTabCount ( ) == 0 ) return ; Vector < Tab > tabs = getHalfLeastUsedTabs ( getCurrentTab ( ) ) ; if ( tabs . size ( ) > 0 ) { Log . w ( LOGTAG , "Free " + tabs . size ( ) + " tabs in the browser" ) ; for ( Tab t : tabs ) { t . saveState ( ) ; t . destroy ( ) ; } return ; } Log . w ( LOGTAG , "Free WebView's unused memory and cache" ) ; WebView view = getCurrentWebView ( ) ; if ( view != null ) { view . freeMemory ( ) ; } }
free the memory in this order , 1 ) free the background tabs ; 2 ) free the webview cache ;
