A full GC is quite expensive so I wouldn't use MLton.GC.collect as the only way to close the database. You could use finalizers to do the close if needed, but normally just do the close by hand.