-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems getting no-leaks working (to detect memory leaks) #160
Comments
PHP running out of memory can't be stopped. Increase your memory limit and try again perhaps. no-leaks can only work if the processing can finish first. |
Hi @asgrim You wrote:
In this environment, I get the same output:
Testing again with larger |
You really want to run it with 1Gb or such, though.
|
Thanks @Ocramius
You are correct. I have fixed this issue (the Running with the
|
And PHPUnit also fails (without this tool)? To me, it looks like you're just running a large test suite, which is indeed leaking somewhere, but to find the leaks, you must first be able to run it to completion. You have two ways forward:
The fact that it errors out is also potentially indicating that your test suite is highly stateful, which is a design flaw: does your suite run fine if you randomize execution order? |
If you're running a machine with lots of RAM, try memory_limit of just below what you have available, e.g. if you have 64GB RAM, try with 62GB for example (with caution, make sure you know what you're doing!). If you still cannot run it, there is something using a lot of RAM, at this point there is usually a clear explanation if you consider your codebase carefully. |
Just to be clear: leaking tests should show, but after the full test suite has run (at which point this tool generates a report). If tests cannot be repeated, that already is an indicator of unclean test shutdown. |
I have a PHP project and I run no-leaks as follows:
It runs, but produces no information about the memory leak:
Other information:
7.3.33
(I have tested other versions also)8.0.6
export XDEBUG_MODE=coverage
1.1.2
The text was updated successfully, but these errors were encountered: