Skip to content

Always init descriptors ht as non-packed - #29

Merged
mvorisek merged 5 commits into
php:mainfrom
mvorisek:fix_ht_resize_at_9th_iter
Jun 3, 2025
Merged

mvorisek merged 5 commits into
php:mainfrom
mvorisek:fix_ht_resize_at_9th_iter

Conversation

@mvorisek

@mvorisek mvorisek commented Jun 3, 2025 •

Copy link
Copy Markdown
Collaborator

fix #4

Simillar to many of zend_hash_real_init_mixed() usage in php-src.

Credit goes to @nielsdos as he identified the problem is in https://github.com/php/pecl-database-oci8/blob/v3.4/oci8_lob.c#L106.

@mvorisek
mvorisek marked this pull request as ready for review June 3, 2025 21:21
@mvorisek

mvorisek commented Jun 3, 2025

Copy link
Copy Markdown
Collaborator Author

@nielsdos I think I nailed the solution. Can you please approve this PR?

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the missing piece of the puzzle is that the bottom slots of the packed array were never reused and then the conversion happens once the "load factor" heuristic triggers. Then we still have some unused slots because of how the conversion works and we are left with unused memory.
The idea makes sense.

@mvorisek
mvorisek merged commit 7aa1061 into php:main Jun 3, 2025
@mvorisek
mvorisek deleted the fix_ht_resize_at_9th_iter branch June 3, 2025 22:27
mvorisek added a commit that referenced this pull request Jun 18, 2025
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.

oci8 is leaking memory with long query/CLOB

2 participants