no-leaks

:potable_water: PHPUnit Plugin for detecting Memory Leaks in code and tests

  • Owner: Roave/no-leaks
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

roave/no-leaks

Build Status
Latest Stable Version

roave/no-leaks

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 beeing executed properly cleans up after itself.

Installation

composer require --dev roave/no-leaks

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

vendor/bin/roave-no-leaks supports all
configuration parameters and console parameters of PHPUnit.

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

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

Main metrics

Overview
Name With OwnerRoave/no-leaks
Primary LanguagePHP
Program languagePHP (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2019-03-14 21:10:31
Pushed At2025-05-29 23:20:22
Last Commit At
Release Count8
Last Release Name1.5.0 (Posted on 2023-08-02 18:56:15)
First Release Name1.0.0 (Posted on 2019-03-15 21:32:20)
用户参与
Stargazers Count501
Watchers Count16
Fork Count20
Commits Count568
Has Issues Enabled
Issues Count21
Issue Open Count6
Pull Requests Count136
Pull Requests Open Count6
Pull Requests Close Count23
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private