My favorites | Sign in
Project Home Downloads Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 781: CActiveRecord::find/find/findbysql and most other finds eat memory
4 people starred this issue and may be notified of changes. Back to list
Status:  Migrated
Owner:  qiang.xue

Sign in to add a comment
Reported by, Jan 2, 2010
What steps will reproduce the problem?
1. Do anytype of 'find' over 1500 times and -out of memory- if allowed
memory=16MB.  Specific example is here:
$model=Account::model()->find('code=:code AND companyId=:companyId',
array(':code'=>$accountCode,':companyId'=> $companyId));
2. Have tried all the different find functions in CActiveRecord with the
same result. Even going to queryScaler does the crash.

What is the expected output? What do you see instead?
The error I get is typically(varies):
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 72 bytes) in /var/www/yii/framework/db/CDbCommand.php on line 115

What version of the product are you using? On what operating system?
1.10 RC 1 January 1

Please provide any additional information below.

Jan 2, 2010
Project Member #1 qiang.xue
Please try it with higher memory limit, such as 32MB. The size 16MB is a bit small if
you have enabled many PHP extensions. We have tested the similar function call before
without observing any memory leak issue.
Status: Invalid
Jan 2, 2010
If your using i think it was XAMPP on Mac OS X there was a bug that would cause this
type of problem. I was going to convert my windows and mac development servers to
XAMPP before I discovered the bug in the Mac version. increasing the memory didn't
help and the problem was actually related to the memory for threads in MySQL. You
could change the memory allocated to the threads but the value was never respected
and seemed to have a hard coded value it used.
Jun 15, 2010
Project Member #3 alexander.makarow
Should be solved by
Status: Fixed
Feb 15, 2012
Project Member #4 qiang.xue
Migrated to
Status: Migrated
Feb 15, 2012
Project Member #5 qiang.xue
Migrated to
Sign in to add a comment

Powered by Google Project Hosting