GithubHelp home page GithubHelp logo

no-leaks's People

Contributors

belgattitude avatar danielruf avatar dependabot-preview[bot] avatar goetas avatar mikeshatch avatar mvorisek avatar ocramius avatar renovate[bot] avatar sad270 avatar samnela avatar senseexception avatar staabm avatar xepozz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

no-leaks's Issues

Writing to outbut buffer alters output

Hey,

I'm having a go with this in Psalm's codebase in this branch.

I have a file where no-leaks complains, unless I add echo ' '; after each test run, in which case there are no problems reported. Psalm doesn't manipulate the output buffer at all, so I'm baffled as to what might lead to the weird behaviour.

vendor/bin/roave-no-leaks tests/FileUpdates/AnalyzedMethodTest

Echo in question here: https://github.com/vimeo/psalm/blob/php-71/tests/FileUpdates/AnalyzedMethodTest.php

`Invalid negative memory usage`

I'm just taking this new package for a spin against several projects I'm working on and in one of them I'm getting the following error and stack trace;

Fatal error: Uncaught Exception: Baseline memory usage of -376 detected: invalid negative memory usage in /var/www/html/vendor/roave/no-leaks/src/MeasuredTestRunMemoryLeak.php:48
Stack trace:
#0 [internal function]: Roave\NoLeaks\PHPUnit\MeasuredTestRunMemoryLeak::Roave\NoLeaks\PHPUnit\{closure}(14780840, 14780464)
#1 /var/www/html/vendor/roave/no-leaks/src/MeasuredTestRunMemoryLeak.php(52): array_map(Object(Closure), Array, Array)
#2 [internal function]: Roave\NoLeaks\PHPUnit\MeasuredTestRunMemoryLeak::fromTestMemoryUsages(Array, Array)
#3 /var/www/html/vendor/roave/no-leaks/src/CollectTestExecutionMemoryFootprints.php(92): array_map(Array, Array, Array)
#4 /var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(636): Roave\NoLeaks\PHPUnit\CollectTestExecutionMemoryFootprints->executeAfterLastTest()
#5 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(208): PHPUnit\TextUI\TestRunner->doRun(Object(PHPUnit\Framework\TestSuite), Array, true)
#6 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(164 in /var/www/html/vendor/roave/no-leaks/src/MeasuredTestRunMemoryLeak.php on line 48

I know this is an intended exception, but that being said, I'm not doing anything weird in my code with regards to memory usage. Please let me know if I can provide any further details that could help to narrow down a potential issue in the accurate detection of memory usage.

No-leaks doesn't play nice with roave/dont

Seems that using use JustDont; in classes makes vendor/bin/roave-no-leaks fail on a lot of tests.
As by removing the usage of roave/dont I stopped getting errors.

If this behaviour is to be expected a note in the Readme would probably do the job.

Support for PHP 7.2?

PHP 7.3 got just released, is there a specific reason for having it as the minimum version and not the more widely used version 7.2?

Anonymous class leaks if included many times

Anonymous class is created newly even if it's php AST remains the same when included by require multiple times.

Tests should test this by including file like:

<?php

new class() {
};

1000x times (2x is not enought, as php cache slots for new classes)

Exception: At least 3 baseline test run memory profiles are required, 2 given in roave/no-leaks/src/MeasuredBaselineTestMemoryLeak.php:70

Hi, I have encountered this issue and I have no idea what does it means.

Doing var_dump($nonNegativeMemoryUsages); in MeasuredBaselineTestMemoryLeak.php:70

result:

array(1) {
  [0] =>
  int(32)
}

Full error dump:

Exception: At least 3 baseline test run memory profiles are required, 2 given in /var/www/html/vendor/roave/no-leaks/src/MeasuredBaselineTestMemoryLeak.php:70
Stack trace:
#0 /var/www/html/vendor/roave/no-leaks/src/CollectTestExecutionMemoryFootprints.php(76): Roave\NoLeaks\PHPUnit\MeasuredBaselineTestMemoryLeak::fromBaselineTestMemoryUsages(Array, Array)
#1 /var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(599): Roave\NoLeaks\PHPUnit\CollectTestExecutionMemoryFootprints->executeAfterLastTest()
#2 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(208): PHPUnit\TextUI\TestRunner->doRun(Object(PHPUnit\Framework\TestSuite), Array, true)
#3 /var/www/html/vendor/roave/no-leaks/bin/roave-no-leaks.php(46): PHPUnit\TextUI\Command->run(Array, true)
#4 /var/www/html/vendor/roave/no-leaks/bin/roave-no-leaks.php(47): Roave\NoLeaks\CLI\{closure}()
#5 /var/www/html/vendor/roave/no-leaks/bin/roave-no-leaks(9): require('/var/www/html/v...')
#6 /var/www/html/vendor/roave/no-leaks/bin/roave-no-leaks(10): Roave\NoLeaks\CLI\{closure}()
#7 {main}

Can you please provide any hint what this means and how to solve this? If you need additional info, just tell me what to look for.

Thanks a lot. :)

Readme: describe what a leak is

I feel it would be usefull to give a bit more context in the readme, on what a leak in the context of this package means (maybe even add a/a few examples when php code leaks - and what resulting problem is.

Since php is not a memory managed language its not 100% clear why/how php userland code can leak memory

May not inherit from final class

When we install PHPUnit bridge from Symfony v4 (as you advise) and Roave/no-leaks (actual) and then try to use standart symfony's console command 'php bin/phpunit' we get an error:

"PHP Fatal error: Class Symfony\Bridge\PhpUnit\Legacy\TestRunnerForV7 may not inherit from final class (PHPUnit\TextUI\TestRunner) in /home/NIX/kruhliak/Projects/second/vendor/symfony/phpunit-bridge/Legacy/TestRunnerForV7.php on line 22"

So, if we want to execute tests without memory test, we must use command './vendor/bin/phpunit/' with options without Symfony's bridge.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Lock file maintenance

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

composer
composer.json
  • php ~8.1.0 || ~8.2.0
  • phpunit/phpunit ^9.6.20
  • doctrine/coding-standard ^12.0.0
  • roave/infection-static-analysis-plugin ^1.35.0
  • psalm/plugin-phpunit ^0.19.0
  • squizlabs/php_codesniffer ^3.10.2
  • vimeo/psalm ^5.25.0
github-actions
.github/workflows/continuous-integration.yml
  • laminas/laminas-ci-matrix-action 1.27.0@38e146b542b4952fea583408acff8dcddf20b427
  • laminas/laminas-continuous-integration-action 1.40.0@f474cab0f489b50c3b31d6ae04f0a5fc189c796d
.github/workflows/release-on-milestone-closed.yml
  • actions/checkout v4
  • laminas/automatic-releases v1
  • laminas/automatic-releases v1
  • laminas/automatic-releases v1
  • laminas/automatic-releases v1

  • Check this box to trigger a request for Renovate to run again on this repository

Always getting Could not find baseline test: impossible to determine PHPUnit base memory overhead

I'm always getting at the end of the test results...

Fatal error:  Uncaught Exception: Could not find baseline test: impossible to determine PHPUnit base memory overhead in /var/www/app/vendor/roave/no-leaks/src/CollectTestExecutionMemoryFootprints.php:71
Stack trace:
#0 /var/www/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(605): Roave\NoLeaks\PHPUnit\CollectTestExecutionMemoryFootprints->executeAfterLastTest()
#1 /var/www/app/vendor/phpunit/phpunit/src/TextUI/Command.php(207): PHPUnit\TextUI\TestRunner->doRun(Object(PHPUnit\Framework\TestSuite), Array, true)
#2 /var/www/app/vendor/roave/no-leaks/bin/roave-no-leaks.php(46): PHPUnit\TextUI\Command->run(Array, true)
#3 /var/www/app/vendor/roave/no-leaks/bin/roave-no-leaks.php(47): Roave\NoLeaks\CLI\{closure}()
#4 /var/www/app/vendor/roave/no-leaks/bin/roave-no-leaks(9): require('/var/www/app/ve...')
#5 /var/www/app/vendor/roave/no-leaks/bin/roave-no-leaks(10): Roave\NoLeaks\CLI\{closure}()

PHPUnit 8.1.2

PHP 7.3.0 (cli) (built: Dec 29 2018 04:45:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.0, Copyright (c) 1999-2018, by Zend Technologies

No XDebug installed.

Any idea?

Single call to gc_collect_cycles don't collect all GC

Is not an issue just a question, is totally wrong in place of calling gc_collect_cycles() calls this function :

    private function forceGarbageCollection()
    {
        for ($a = 0; $a < 3; $a++) {
            // this can be a while, but foreach is better to avoid infinite loop

            $before = memory_get_usage();

            gc_collect_cycles();

            $after = memory_get_usage();

            if ($before - $after === 0) {
                return;
            }
        }
    }

At least in my tests with these extra calls I see less leaks reported.
It seems that PHP cannot collect all the garbage in a single call.

FYI usually after 2 calls the delta memory between before and after goes to zero.

Never end

Hello,

The tests suite never end with ./vendor/bin/roave-no-leaks, I have to stop it by hand, so I don't have any results.

Tested with phpunit 8.0., phpunit 8.1. phpunit 8.2., phpunit 8.3.

PHPUnit 8.0.6 by Sebastian Bergmann and contributors.

..................................FF.........................   61 / 2251 (  2%)
.....................................................SS......  122 / 2251 (  5%)
.............................................................  183 / 2251 (  8%)
.............................................................  244 / 2251 ( 10%)
...................EE........................................  305 / 2251 ( 13%)
.......F.....................................................  366 / 2251 ( 16%)
.....................EE.F.EEE..EE.FFEEEE..E...E..F.EE..F.F.E.  427 / 2251 ( 18%)
E.EE.E........EEEEEE..EEE.E.E.....E..I.I.....................  488 / 2251 ( 21%)
.............................................................  549 / 2251 ( 24%)
.EEEEEEE...F.EE..............................................  610 / 2251 ( 27%)
.....III.I...........................................EEEEEEEE  671 / 2251 ( 29%)
E.........................................................FF.  732 / 2251 ( 32%)
....................................E........................  793 / 2251 ( 35%)
.............................................................  854 / 2251 ( 37%)
.............................................................  915 / 2251 ( 40%)
.............................................................  976 / 2251 ( 43%)
............................F.EEE............................ 1037 / 2251 ( 46%)
............................FE.EE.E.EE...E..EEE..EE..E..EE..E 1098 / 2251 ( 48%)
..E..EE..EEEE..E..EE..EE..EE..E..E....EE..EEEEE..E..EEE..EEEE 1159 / 2251 ( 51%)
..E...E....E..EE..EE..E..EE..E..E..EEEEEEE..EE.........E..... 1220 / 2251 ( 54%)
...........SS................................................ 1281 / 2251 ( 56%)
..........E...E..............E...E...E...E............E...... 1342 / 2251 ( 59%)
..EEEE.............E..EE..EEEE..EEEEE..EEEE..EEEEE..EE..E..EE 1403 / 2251 ( 62%)
..EE..EE..EEEE..E..E..EE.........EEEEE....................... 1464 / 2251 ( 65%)
EEEE..EEE..E..EEE..E..E..EE..EE..E..EE..E..E..EE..EEEEE..EE.. 1525 / 2251 ( 67%)
..EE..EEEEEEEEEEEEEEEEEEE....EE..EE..EEEE....E..EEEE..EE..EEE 1586 / 2251 ( 70%)
EE..EEE..EEEEEE..EEE..EEE..EEEE..EE..E..E..E..EE..E..EEEEE..E 1647 / 2251 ( 73%)
EEEEEE..EEEE..E..E........EE..E..E..........EE....E..E..EE..E 1708 / 2251 ( 75%)
EEE..E..E..EE..EE..EEEE..E..EE..EE..EEEEEEEE..EEE..E..E..EE.. 1769 / 2251 ( 78%)
EEEEEE..EE..EE..E....FFEEEEEEE..F..EEEE.....E..EEEEEEEEE..E.. 1830 / 2251 ( 81%)
E..EEE..EEE..EEEE..EEEEE..EEEE..E..EEEEEEEEEEE..EE..EE..EEEEE 1891 / 2251 ( 84%)
..E..EE......EE..EE..EEEE..EEEE..E..EEE..EEEEEEEEE....EEEEE.. 1952 / 2251 ( 86%)
EE..EEEE..EEE..E..EEEEE..E..E..EE......................E..EEE 2013 / 2251 ( 89%)
..EEE..EEE..EEEE..EEEE..EEEEE....EEEEE....EEE..EE..EEE..EE..E 2074 / 2251 ( 92%)
....E....EEEE..E.....EE..EEEEEE..EEEEEE....EEEEE..EE.....EE.. 2135 / 2251 ( 94%)
..EEE..EEEE..EE..EEE..EEEEE..EE..EEEEE.....EE.....EEE..EEEEE. 2196 / 2251 ( 97%)
....EEEEE.....EEE..E..E..EEE..E....EEE.................       2251 / 2251 (100%).EE..E 2257 / 2251 (100%)
....EEE....EE..E...........................................E. 2318 / 2251 (102%)
..E......E...E..E..E.......EE..EE..E..EE..E..EEEEEE..E..EE... 2379 / 2251 (105%)
PHPUnit 8.1.6 by Sebastian Bergmann and contributors.

..................................FF.........................   61 / 2251 (  2%)
.....................................................SS......  122 / 2251 (  5%)
.............................................................  183 / 2251 (  8%)
.............................................................  244 / 2251 ( 10%)
...................EE........................................  305 / 2251 ( 13%)
.......F.....................................................  366 / 2251 ( 16%)
.....................EE.F.EEE..EE.FFEEEE..E...E..F.EE..F.F.E.  427 / 2251 ( 18%)
E.EE.E........EEEEEE..EEE.E.E.....E..I.I.....................  488 / 2251 ( 21%)
.............................................................  549 / 2251 ( 24%)
.EEEEEEE...F.EE..............................................  610 / 2251 ( 27%)
.....III.I...........................................EEEEEEEE  671 / 2251 ( 29%)
E.........................................................FF.  732 / 2251 ( 32%)
....................................E........................  793 / 2251 ( 35%)
.............................................................  854 / 2251 ( 37%)
.............................................................  915 / 2251 ( 40%)
.............................................................  976 / 2251 ( 43%)
............................F.EEE............................ 1037 / 2251 ( 46%)
............................FE.EE.E.EE...E..EEE..EE..E..EE..E 1098 / 2251 ( 48%)
..E..EE..EEEE..E..EE..EE..EE..E..E....EE..EEEEE..E..EEE..EEEE 1159 / 2251 ( 51%)
..E...E....E..EE..EE..E..EE..E..E..EEEEEEE..EE.........E..... 1220 / 2251 ( 54%)
...........SS................................................ 1281 / 2251 ( 56%)
..........E...E..............E...E...E...E............E...... 1342 / 2251 ( 59%)
..EEEE.............E..EE..EEEE..EEEEE..EEEE..EEEEE..EE..E..EE 1403 / 2251 ( 62%)
..EE..EE..EEEE..E..E..EE.........EEEEE....................... 1464 / 2251 ( 65%)
EEEE..EEE..E..EEE..E..E..EE..EE..E..EE..E..E..EE..EEEEE..EE.. 1525 / 2251 ( 67%)
..EE..EEEEEEEEEEEEEEEEEEE....EE..EE..EEEE....E..EEEE..EE..EEE 1586 / 2251 ( 70%)
EE..EEE..EEEEEE..EEE..EEE..EEEE..EE..E..E..E..EE..E..EEEEE..E 1647 / 2251 ( 73%)
EEEEEE..EEEE..E..E........EE..E..E..........EE....E..E..EE..E 1708 / 2251 ( 75%)
EEE..E..E..EE..EE..EEEE..E..EE..EE..EEEEEEEE..EEE..E..E..EE.. 1769 / 2251 ( 78%)
EEEEEE..EE..EE..E....FFEEEEEEE..F..EEEE.....E..EEEEEEEEE..E.. 1830 / 2251 ( 81%)
E..EEE..EEE..EEEE..EEEEE..EEEE..E..EEEEEEEEEEE..EE..EE..EEEEE 1891 / 2251 ( 84%)
..E..EE......EE..EE..EEEE..EEEE..E..EEE..EEEEEEEEE....EEEEE.. 1952 / 2251 ( 86%)
EE..EEEE..EEE..E..EEEEE..E..E..EE......................E..EEE 2013 / 2251 ( 89%)
..EEE..EEE..EEEE..EEEE..EEEEE....EEEEE....EEE..EE..EEE..EE..E 2074 / 2251 ( 92%)
....E....EEEE..E.....EE..EEEEEE..EEEEEE....EEEEE..EE.....EE.. 2135 / 2251 ( 94%)
..EEE..EEEE..EE..EEE..EEEEE..EE..EEEEE.....EE.....EEE..EEEEE. 2196 / 2251 ( 97%)
....EEEEE.....EEE..E..E..EEE..E....EEE.................       2251 / 2251 (100%).EE..E 2257 / 2251 (100%)
....EEE....EE..E...........................................E. 2318 / 2251 (102%)
..E......E...E..E..E.......EE..EE..E..EE..E..EEEEEE..E..EE... 2379 / 2251 (105%)
.E..EEE....EE..EEEEE..EE..EE....E..EE..EE..EE..E..E..E..E..EE 2440 / 2251 (108%)
PHPUnit 8.2.5 by Sebastian Bergmann and contributors.

..................................FF.........................   61 / 2251 (  2%)
.....................................................SS......  122 / 2251 (  5%)
.............................................................  183 / 2251 (  8%)
.............................................................  244 / 2251 ( 10%)
...................EE........................................  305 / 2251 ( 13%)
.......F.....................................................  366 / 2251 ( 16%)
.....................EE.F.EEE..EE.FFEEEE..E...E..F.EE..F.F.E.  427 / 2251 ( 18%)
E.EE.E........EEEEEE..EEE.E.E.....E..I.I.....................  488 / 2251 ( 21%)
.............................................................  549 / 2251 ( 24%)
.EEEEEEE...F.EE..............................................  610 / 2251 ( 27%)
.....III.I...........................................EEEEEEEE  671 / 2251 ( 29%)
E.........................................................FF.  732 / 2251 ( 32%)
....................................E........................  793 / 2251 ( 35%)
.............................................................  854 / 2251 ( 37%)
.............................................................  915 / 2251 ( 40%)
.............................................................  976 / 2251 ( 43%)
............................F.EEE............................ 1037 / 2251 ( 46%)
............................FE.EE.E.EE...E..EEE..EE..E..EE..E 1098 / 2251 ( 48%)
..E..EE..EEEE..E..EE..EE..EE..E..E....EE..EEEEE..E..EEE..EEEE 1159 / 2251 ( 51%)
..E...E....E..EE..EE..E..EE..E..E..EEEEEEE..EE.........E..... 1220 / 2251 ( 54%)
...........SS................................................ 1281 / 2251 ( 56%)
..........E...E..............E...E...E...E............E...... 1342 / 2251 ( 59%)
..EEEE.............E..EE..EEEE..EEEEE..EEEE..EEEEE..EE..E..EE 1403 / 2251 ( 62%)
..EE..EE..EEEE..E..E..EE.........EEEEE....................... 1464 / 2251 ( 65%)
EEEE..EEE..E..EEE..E..E..EE..EE..E..EE..E..E..EE..EEEEE..EE.. 1525 / 2251 ( 67%)
..EE..EEEEEEEEEEEEEEEEEEE....EE..EE..EEEE....E..EEEE..EE..EEE 1586 / 2251 ( 70%)
EE..EEE..EEEEEE..EEE..EEE..EEEE..EE..E..E..E..EE..E..EEEEE..E 1647 / 2251 ( 73%)
EEEEEE..EEEE..E..E........EE..E..E..........EE....E..E..EE..E 1708 / 2251 ( 75%)
EEE..E..E..EE..EE..EEEE..E..EE..EE..EEEEEEEE..EEE..E..E..EE.. 1769 / 2251 ( 78%)
EEEEEE..EE..EE..E....FFEEEEEEE..F..EEEE.....E..EEEEEEEEE..E.. 1830 / 2251 ( 81%)
E..EEE..EEE..EEEE..EEEEE..EEEE..E..EEEEEEEEEEE..EE..EE..EEEEE 1891 / 2251 ( 84%)
..E..EE......EE..EE..EEEE..EEEE..E..EEE..EEEEEEEEE....EEEEE.. 1952 / 2251 ( 86%)
EE..EEEE..EEE..E..EEEEE..E..E..EE......................E..EEE 2013 / 2251 ( 89%)
..EEE..EEE..EEEE..EEEE..EEEEE....EEEEE....EEE..EE..EEE..EE..E 2074 / 2251 ( 92%)
....E....EEEE..E.....EE..EEEEEE..EEEEEE....EEEEE..EE.....EE.. 2135 / 2251 ( 94%)
..EEE..EEEE..EE..EEE..EEEEE..EE..EEEEE.....EE.....EEE..EEEEE. 2196 / 2251 ( 97%)
....EEEEE.....EEE..E..E..EEE..E....EEE.................       2251 / 2251 (100%).EE..E 2257 / 2251 (100%)
....EEE....EE..E...........................................E. 2318 / 2251 (102%)
..E......E...E..E..E.......EE..EE..E..EE..E..EEEEEE..E..EE... 2379 / 2251 (105%)
.E..EEE....EE..EEEEE..EE..EE....E..EE..EE..EE..E..E..E..E..EE 2440 / 2251 (108%)
E....EE..EE..EE..E.......EE..EE..E..EE......E...EEE...EE...E. 2501 / 2251 (111%)
PHPUnit 8.3.5 by Sebastian Bergmann and contributors.

..................................FF.........................   61 / 2251 (  2%)
.....................................................SS......  122 / 2251 (  5%)
.............................................................  183 / 2251 (  8%)
.............................................................  244 / 2251 ( 10%)
...................EE................................FFFF....  305 / 2251 ( 13%)
.......F.F.FF.FF.F.FF.F.F.FF.EFFFF.FF..FF....................  366 / 2251 ( 16%)
................FFFF.EE.F.EEE..EE.FFEEEE..E...E..F.EE..F.F.E.  427 / 2251 ( 18%)
E.EE.E........EEEEEE..EEE.E.E.....E..I.I.....................  488 / 2251 ( 21%)
.............................................................  549 / 2251 ( 24%)
.EEEEEEE...F.EE..............................................  610 / 2251 ( 27%)
.....III.I...........................................EEEEEEEE  671 / 2251 ( 29%)
E.........................................................FF.  732 / 2251 ( 32%)
....................................E........................  793 / 2251 ( 35%)
.............................................................  854 / 2251 ( 37%)
.............................................................  915 / 2251 ( 40%)
.............................................................  976 / 2251 ( 43%)
............................F.EEE............................ 1037 / 2251 ( 46%)
............................FE.EE.E.EE...E..EEE..EE..E..EE..E 1098 / 2251 ( 48%)
..E..EE..EEEE..E..EE..EE..EE..E..E....EE..EEEEE..E..EEE..EEEE 1159 / 2251 ( 51%)
..E...E....E..EE..EE..E..EE..E..E..EEEEEEE..EE.........E..... 1220 / 2251 ( 54%)
...........SS................................................ 1281 / 2251 ( 56%)
..........E...E..............E...E...E...E............E...... 1342 / 2251 ( 59%)
..EEEE.............E..EE..EEEE..EEEEE..EEEE..EEEEE..EE..E..EE 1403 / 2251 ( 62%)
..EE..EE..EEEE..E..E..EE.........EEEEE....................... 1464 / 2251 ( 65%)
EEEE..EEE..E..EEE..E..E..EE..EE..E..EE..E..E..EE..EEEEE..EE.. 1525 / 2251 ( 67%)
..EE..EEEEEEEEEEEEEEEEEEE....EE..EE..EEEE....E..EEEE..EE..EEE 1586 / 2251 ( 70%)
EE..EEE..EEEEEE..EEE..EEE..EEEE..EE..E..E..E..EE..E..EEEEE..E 1647 / 2251 ( 73%)
EEEEEE..EEEE..E..E........EE..E..E..........EE....E..E..EE..E 1708 / 2251 ( 75%)
EEE..E..E..EE..EE..EEEE..E..EE..EE..EEEEEEEE..EEE..E..E..EE.. 1769 / 2251 ( 78%)
EEEEEE..EE..EE..E....FFEEEEEEE..F..EEEE.....E..EEEEEEEEE..E.. 1830 / 2251 ( 81%)
E..EEE..EEE..EEEE..EEEEE..EEEE..E..EEEEEEEEEEE..EE..EE..EEEEE 1891 / 2251 ( 84%)
..E..EE......EE..EE..EEEE..EEEE..E..EEE..EEEEEEEEE....EEEEE.. 1952 / 2251 ( 86%)
EE..EEEE..EEE..E..EEEEE..E..E..EE......................E..EEE 2013 / 2251 ( 89%)
..EEE..EEE..EEEE..EEEE..EEEEE....EEEEE....EEE..EE..EEE..EE..E 2074 / 2251 ( 92%)
....E....EEEE..E.....EE..EEEEEE..EEEEEE....EEEEE..EE.....EE.. 2135 / 2251 ( 94%)
..EEE..EEEE..EE..EEE..EEEEE..EE..EEEEE.....EE.....EEE..EEEEE. 2196 / 2251 ( 97%)
....EEEEE.....EEE..E..E..EEE..E....EEE.................       2251 / 2251 (100%).EE..E 2257 / 2251 (100%)

Tested with php version

php -v
PHP 7.3.4 (cli) (built: Apr  6 2019 03:07:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies

and

php -v
PHP 7.4.0RC1 (cli) (built: Sep 18 2019 21:46:31) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies

roave/no-leaks version 1.1.1

Do you have an idea how to debug this ?

Thanks in advance !

Problems getting no-leaks working (to detect memory leaks)

I have a PHP project and I run no-leaks as follows:

$ ./vendor/bin/roave-no-leaks --configuration test/phpunit.xml --coverage-html coverage

It runs, but produces no information about the memory leak:

$ ./vendor/bin/roave-no-leaks --configuration test/phpunit.xml --coverage-html coverage
PHPUnit 8.0.6 by Sebastian Bergmann and contributors.
.FF.FF...F......FF.FF
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /builds/organisation/organisation-app/vendor/phpunit/php-code-coverage/src/Driver/Xdebug.php on line 98

Other information:

  • PHP is 7.3.33 (I have tested other versions also)
  • PHP Unit is 8.0.6
  • export XDEBUG_MODE=coverage
  • Composer version 1.10.24 2021-12-09 20:06:33
  • roave/no-leaks: 1.1.2

Improve readme, mention repeat and how memory footprint is calculated

Thanks a lot for publishing this tool.
I played around with it to improve memory consumption in TYPO3 CMS functional tests.
And found out 3 things that should be mentioned in the readme to lower the entry barrier.

  1. Mention that no-leaks will run every test 3 times (using --repeat)

    })->run(array_merge($_SERVER['argv'], ['--repeat=3']), true);

    This was an important finding to me, as I found tests which had issues when run using --repeat (due too unset in teardown)

  2. It would be great to describe how does the tool work -> how is the memory calculation / comparison made, especially, how is the baseline calculated,

  3. would be great to shed more light on the statement "memory leak detection for scalar types and arrays is not reliable"
    in what way it's not reliable? what to expect?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.