Ticket Details
Memory Issues with Document Object
ENHANCEMENT Ticket (in progress)
###What happened:
Iterating through a document object via Model::find('all') with a large dataset (say 9,000 results) from MongoDB causes a fatal memory issue. There are no issues iterating through a result from MongoCollection::find()
For instance:
{{{
$conditions = array(
'date_created' => array(
'$gt' => new MongoDate(strtotime($this->request->data['min_date'])),
'$lte' => new MongoDate(strtotime($this->request->data['max_date']))
));
$orders = Order::find('all', array('conditions' => $conditions));
foreach ($orders as $order) {
...do something...
...fatal error happens here...
}
}}}
[Here is the stack trace](http://pastium.org/view/ec9b22862f1eea719e62e1d728cc7653)
###What was expected:
For large datasets the document object shouldn't cause a fatal memory issue.
Updates
on 11.16.10
by fitzagard
- type was changed to bug
- priority was changed to normal
on 11.21.10
by jperras
- owner was changed to jperras
- status was changed to in progress
on 03.07.11
by nate
- owner was removed
- type was changed to enhancement
on 05.02.11
by edmunc