Scheduled Backup Question

Running a C8 on the latest version.
@gopher.ny
It seems that when the scheduled backup runs, it sometimes does a memory clean up. Is that based on the database size? If so, what is the threshold for doing the memory clean up?

Edit: The scheduled backup sometimes does a database rebuild. Is that based on the database size? What is the threshold for the DB size to do the rebuild?