Skip to content
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

(fix) set memory baseline on MemoryCollector #559

Merged
merged 2 commits into from
Sep 19, 2023

Conversation

erikn69
Copy link
Contributor

@erikn69 erikn69 commented Sep 15, 2023

Fixes barryvdh/laravel-debugbar#1324
Fixes barryvdh/laravel-debugbar#1434

This pr allows only the memory peak to be shown with a baseline, this would normalize the differences in the presentation, currently the maximum peak of the process is shown, but only the memory used by the application should be shown

For example, in Windows a fresh app shows 20MB, while the same app in Linux only shows 3MB.
Added memory_reset_peak_usage for only check execution peaks

@barryvdh
Copy link
Collaborator

In the case of Laravel, wouldn't this discard the memory usage from the process up to the constructor of this class?

@erikn69
Copy link
Contributor Author

erikn69 commented Sep 19, 2023

Laravel, wouldn't this discard the memory usage from the process up to the constructor of this class?

Yes, before the service provider.
But still, it would only show the execution peaks within the script(the real app code)
any other solution? Should it be optional?

@barryvdh
Copy link
Collaborator

For the Octane problem, it would be enough to provide a method to reset for subsequent executions, but calling the memory_reset_peak_usage function might have unexpected results for other tools.

@erikn69
Copy link
Contributor Author

erikn69 commented Sep 19, 2023

Same app

WITH THIS PR:

Linux
image
Windows
image


WITHOUT THIS PR:

Linux
image
Windows
image

On windows memory goes up, the same app, also for mac

@barryvdh
Copy link
Collaborator

Yes but the actual process is using the highest variant, right?

@barryvdh barryvdh merged commit 1d87377 into maximebf:master Sep 19, 2023
7 checks passed
@barryvdh
Copy link
Collaborator

I removed it from the constructor (for now). We can add it to the laravel-debugbar if Octane is running for example.

@erikn69
Copy link
Contributor Author

erikn69 commented Sep 19, 2023

the actual process is using the highest variant, right?

Without memory_reset_peak_usage yes, on the peak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

debug bar showing 19-21mb memory usage on clean install laravel (welcome page) octane(swoole) memory leak
2 participants