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

[9.x] Fixes memory leak on anonymous migrations #46073

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

nunomaduro
Copy link
Member

@nunomaduro nunomaduro commented Feb 10, 2023

This pull request resolves an issue with memory leaks in Laravel test suites that utilize anonymous migrations. The leak is a result of an internal memory issue within PHP when anonymous classes are utilized. It is important to note that this fix will only be noticeable if the user uses the RefreshDatabase trait, and in-memory databases.

// Use case 1: 702 feature tests

// Before:
Time: 00:23.628, Memory: 324.00 MB
// After
Time: 00:21.393, Memory: 40.00 MB

---
// Use case 2: 233 feature tests

// Before:
Time: 01:03.643, Memory: 147.00 MB
// After
Time: 01:01.898, Memory: 82.50 MB

Fixes #46029.

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.

Memory Leak when running anonymous class migrations in PHPUnit test
2 participants