🚰 PHPUnit Plugin for detecting Memory Leaks in code and tests
PHP
503
568 commits
updated Oct 9, 2026

This library is a PHPUnit plugin
that detects memory leaks in tested code or tests.
It utilizes memory_get_usage() to make sure the code being executed properly cleans up after itself.
composer require --dev roave/no-leaks
vendor/bin/roave-no-leaks
If any memory leaks are detected, you should see an output like following:
Exception: The following test produced memory leaks:
* My\Leaky\Test::testSomething
* My\Leaky\Test::testSomethingElse
vendor/bin/roave-no-leaks supports all
configuration parameters and console parameters of PHPUnit.
Please be aware that this is not a full substitute for PHPUnit:
If you need help with setting up this library in your project, you can contact us at [email protected] for consulting/support.
5,267 followers · starred Mar 2019
427 followers · starred Mar 2019
751 followers · starred Mar 2019
77 followers · starred Jun 2021
🚰 PHPUnit Plugin for detecting Memory Leaks in code and tests
PHP
503
568 commits
updated Oct 9, 2026

This library is a PHPUnit plugin
that detects memory leaks in tested code or tests.
It utilizes memory_get_usage() to make sure the code being executed properly cleans up after itself.
composer require --dev roave/no-leaks
vendor/bin/roave-no-leaks
If any memory leaks are detected, you should see an output like following:
Exception: The following test produced memory leaks:
* My\Leaky\Test::testSomething
* My\Leaky\Test::testSomethingElse
vendor/bin/roave-no-leaks supports all
configuration parameters and console parameters of PHPUnit.
Please be aware that this is not a full substitute for PHPUnit:
If you need help with setting up this library in your project, you can contact us at [email protected] for consulting/support.
5,267 followers · starred Mar 2019
427 followers · starred Mar 2019
751 followers · starred Mar 2019
77 followers · starred Jun 2021