code: public void compact() throws CouchbaseLiteException {
          synchronized (lock) {
              mustBeOpen();
              try {
                  getC4Database().compact();
              }
              catch (LiteCoreException e) {
                  throw CBLStatus.convertException(e);
              }
          }
      }
docs: Compacts the database file by deleting unused attachment files and vacuuming the SQLite database