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

Fatal Error: Allowed Memory Exhausted using find in Phalcon\Mvc\Collection

I'm using mongodb and have a large collection that seems to use a bunch of memory when running find on the collection.

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes)

The collection is indexed. The query I'm running looks like this:

$results = Listing::find($criteria)->limit(10);

Any ideas would be great. I need to determine if I need to query the db directly and would prefer to use the Mvc\Collection.

Thanks, Ben

I haven't been able to make any progress on this. I've ended up creating a MongoWrapper model that I use to call the queries directly on Mongo for the larger collections.

got a code example?

I am also having this issue, any ideas @phalcon?

Did anyone get around this?