Steps to replicate the issue (include links if applicable):
- Configure the main cache and job queue to use Redis.
- Run importImages.php on a path with many files (>=1000).
- In another shell, check the memory usage of that PHP process.
What happens?:
Memory usage keeps growing, and eventually run out of memory.
After memory profiling, I noticed the major issue is BufferingStatsdDataFactory->buffer keeps growing and never clear because $wgStatsdServer was not set.
What should have happened instead?:
Memory usage stays at a reasonable level.
Software version (skip for WMF-hosted wikis like Wikipedia):
MediaWiki 1.39.1
Other information (browser name/version, screenshots, etc.):
Similar to T181385