When running under PHP 8 (revision a8e8c40ad4), tests eventually run out of memory with a message like
mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory Fatal error: Out of memory (allocated 2204106752) (tried to allocate 20480 bytes) in /vagrant/mediawiki/includes/ServiceWiring.php on line 780
Memory usage profiling of several test cases via php-memprof suggests that what's not getting released are service wirings loaded in ServiceContainer::loadWiringFiles():