We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon3 - Model::Find() with bind high memory usage (PHQL cache).

I tried the solutions provided before on similar issues.

https://github.com/phalcon/cphalcon/issues/2705 https://docs.phalcon.io/en/latest/reference/models-cache.html#caching-of-phql-planning https://forum.phalcon.io/discussion/3652/out-of-memory-when-doing-find-

find() with bind, FindByid and FindFirstById has got a high usage of memory, probably PHQL cache is not working properly. The only thing I have different is ColumnMap but I do not thing that might be the case.

Anyway I am going to try and debug the issue, if anyone has any insight or solution I am most thankfull :)

$di->modelsManager->__destruct() does not solve the issue, memory leak?



34.6k
Accepted
answer

Memory leak is caused by the use of dynamic properties, you can declare all your properties in the model as a workaround.

Hey andy, Thanks that solves most of it, thank you.