-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Memory/resource leaks in the wrapper connection #4515
Labels
Milestone
Comments
TADA! dbal/lib/Doctrine/DBAL/Connection.php Line 222 in de5464d
|
This was referenced Feb 27, 2021
Merged
This was
linked to
pull requests
Feb 27, 2021
TADA! dbal/lib/Doctrine/DBAL/Connection.php Line 1877 in de5464d
|
morozov
added a commit
to morozov/dbal
that referenced
this issue
Apr 1, 2021
morozov
added a commit
to morozov/dbal
that referenced
this issue
Apr 1, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If a wrapper connection is instantiated, establishes a driver-level connection and then is unreferenced, it doesn't get garbage-collected by PHP until GC kicks in (in the best case) and doesn't close the underlying connection.
Example 1
On each iteration, the previously instantiated connection should be destructed and close its driver connection but it isn't the case:
Adding
$conn->close()
to the loop solves the problem however it doesn't do anything than removing the reference to the driver-level connection:dbal/lib/Doctrine/DBAL/Connection.php
Lines 772 to 775 in de5464d
This means that during iteration the object doesn't get destructed.
Example 2
There seems to be an internal circular reference between the wrapper and some of its components that doesn't let the connection to be destructed (see
refcount=2
):The text was updated successfully, but these errors were encountered: