Skip to content

Conversation

aistis-
Copy link
Contributor

@aistis- aistis- commented Aug 8, 2025

Seems that every Value::blob(...) object leaves 64 bytes leftovers in the memory thus causing a memory leak. This was discovered in our PHP long-running scripts which inserts hundred of thousands records per run.

SCR-20250808-pzse-2

@paul-brackin
Copy link
Contributor

@aistis- thanks for the PR. I am curious.. how did you come up with 1KB as being the acceptable memory loss threshold?

We will be investigating your issue soon.

@aistis-
Copy link
Contributor Author

aistis- commented Aug 8, 2025

I did pick 1KB as this is tolerable per 10k iterarations and give a minor space for the fluctuations. However, during the testing it turned out that PHP's garbage collector did a good job and the actual memory usage delta is 0 bytes when used string instead of blob. Feel keep to change the threshold or make it 0.

Note, that the memory leak is linear: 640000 bytes per 10k iterations, 960000 bytes per 15k iterations and so on.

I was testing on PHP 8.3

@khaf khaf merged commit d41f39d into aerospike:main Oct 6, 2025
@khaf
Copy link
Contributor

khaf commented Oct 6, 2025

Merged.

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.

3 participants