PHPackages                             roave/no-leaks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. roave/no-leaks

ActiveLibrary[Testing &amp; Quality](/categories/testing)

roave/no-leaks
==============

1.5.0(2y ago)499277.5k↓18.8%18[6 issues](https://github.com/Roave/no-leaks/issues)[8 PRs](https://github.com/Roave/no-leaks/pulls)8MITPHPPHP ~8.1.0 || ~8.2.0

Since Mar 15Pushed 1mo ago14 watchersCompare

[ Source](https://github.com/Roave/no-leaks)[ Packagist](https://packagist.org/packages/roave/no-leaks)[ RSS](/packages/roave-no-leaks/feed)WikiDiscussions 1.6.x Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (23)Used By (8)

roave/no-leaks
==============

[](#roaveno-leaks)

[![Latest Stable Version](https://camo.githubusercontent.com/666717000d34f44d46dfe3f0adb0f83f2f267de874748427cfa65eb698a4af06/68747470733a2f2f706f7365722e707567782e6f72672f726f6176652f6e6f2d6c65616b732f762f737461626c652e706e67)](https://packagist.org/packages/roave/no-leaks)

[![roave/no-leaks](./logo/no-leaks.png)](./logo/no-leaks.png)

This library is a [PHPUnit](https://github.com/sebastianbergmann/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.

Installation
------------

[](#installation)

```
composer require --dev roave/no-leaks
```

Usage
-----

[](#usage)

```
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

```

Configuration and Parameters
----------------------------

[](#configuration-and-parameters)

[`vendor/bin/roave-no-leaks`](./bin/roave-no-leaks) supports all configuration parameters and console parameters of PHPUnit.

Known Issues
------------

[](#known-issues)

Please be aware that this is not a full substitute for PHPUnit:

- the output format is to be improved
- memory leak detection for scalar types and arrays is not reliable
- can fail depending on xdebug/phpdbg/php-sapi changes

Professional Support
--------------------

[](#professional-support)

If you need help with setting up this library in your project, you can contact us at  for consulting/support.

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance59

Moderate activity, may be stable

Popularity53

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~154 days

Recently: every ~170 days

Total

14

Last Release

616d ago

PHP version history (3 changes)1.0.0PHP ^7.3

1.2.0PHP ^7.4 || ^8.0

1.4.0PHP ~8.1.0 || ~8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd0445bc21fa116c259b5889377b90cbd8a34d49357321f76a74f6d2c2ae6b0c?d=identicon)[Ocramius](/maintainers/Ocramius)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (232 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (208 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (113 commits)")[![belgattitude](https://avatars.githubusercontent.com/u/259798?v=4)](https://github.com/belgattitude "belgattitude (3 commits)")[![mvorisek](https://avatars.githubusercontent.com/u/2228672?v=4)](https://github.com/mvorisek "mvorisek (3 commits)")[![sad270](https://avatars.githubusercontent.com/u/5607440?v=4)](https://github.com/sad270 "sad270 (2 commits)")[![goetas](https://avatars.githubusercontent.com/u/776743?v=4)](https://github.com/goetas "goetas (1 commits)")[![DanielRuf](https://avatars.githubusercontent.com/u/827205?v=4)](https://github.com/DanielRuf "DanielRuf (1 commits)")[![samnela](https://avatars.githubusercontent.com/u/1852108?v=4)](https://github.com/samnela "samnela (1 commits)")[![SenseException](https://avatars.githubusercontent.com/u/859964?v=4)](https://github.com/SenseException "SenseException (1 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (1 commits)")[![xepozz](https://avatars.githubusercontent.com/u/6815714?v=4)](https://github.com/xepozz "xepozz (1 commits)")[![mikeshatch](https://avatars.githubusercontent.com/u/4390485?v=4)](https://github.com/mikeshatch "mikeshatch (1 commits)")

###  Code Quality

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/roave-no-leaks/health.svg)

```
[![Health](https://phpackages.com/badges/roave-no-leaks/health.svg)](https://phpackages.com/packages/roave-no-leaks)
```

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
