Compacting a database removes deleted documents and previous revisions. It is an irreversible operation and may take a while to complete for large databases.
Cleaning up views in a database removes old view files still stored on the filesystem. It is an irreversible operation.