-
Notifications
You must be signed in to change notification settings - Fork 4
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
oci8
is leaking memory with long query/CLOB
#4
Comments
I tried a while to reproduce this but I can't. I amended your test case linked in this issue to run multiple iterations. |
Please fork https://github.com/mvorisek/php-src/tree/fix_oci8_mem_leak branch (php/php-src@master...1310df6), it contains php-src test case. |
There is indeed something weird going on. |
Okay. So the row fetching code calls a callback HashTable *descriptors; /* descriptors hash, used to flush all the LOBs using this connection on commit */ but I don't get it, why would we need that for fetching instead of inserting ? I'm going to inspect that code more now. |
Okay I can confirm that not adding the descriptor to that table here gets rid of the leak: It leaks because in the example test code we never commit anything, we just fetch rows. I think we should not add the descriptor to that table if we're just fetching, because otherwise we will never clear that table. |
@nielsdos but why does this leak only with long query/CLOB? With small query/CLOB, there is no leak. |
I don't think I checked the reason for this, or at least I don't remember a reason. |
This issue could be move to proper repository as the extension has been decoupled from core. |
Description
The following code:
Resulted in this output:
I have verified, the leak is consistent across PHP 7.4 - master and only
oci8
ext is affected. Withpdo_oci
there is no leak for exactly the same query. See https://github.com/atk4/data/runs/7199098438For smaller query, even with CLOB, there is also no leak.
PHP Version
tested PHP 7.4, 8.0, 8.1 and master
Operating System
tested linux and Windows
The text was updated successfully, but these errors were encountered: