code: func (db *Database) Size() (common.StorageSize, common.StorageSize) {
  	db.lock.RLock()
  	defer db.lock.RUnlock()
  
  	// db.dirtiesSize only contains the useful data in the cache, but when reporting
  	// the total memory consumption, the maintenance metadata is also needed to be
  	// counted.
  	var metadataSize = common.StorageSize((len(db.dirties) - 1) * cachedNodeSize)
  	var metarootRefs = common.StorageSize(len(db.dirties[common.Hash{}].children) * (common.HashLength + 2))
  	return db.dirtiesSize + db.childrenSize + metadataSize - metarootRefs, db.preimagesSize
  }
docs: // Size returns the current storage size of the memory cache in front of the
  // persistent database layer.