Skip to content

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

Merged
taylorotwell merged 1 commit into
9.xfrom
fix/memory-leak-on-migrations
Feb 10, 2023
Merged

[9.x] Fixes memory leak on anonymous migrations#46073
taylorotwell merged 1 commit into
9.xfrom
fix/memory-leak-on-migrations

Conversation

@nunomaduro

@nunomaduro nunomaduro commented Feb 10, 2023

Copy link
Copy Markdown
Member

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