Answers.Body: <p>There's probably an error in <code>craft/storage/runtime/logs/phperrors.log</code> and there's a 99% chance the problem is you're hitting your <code>php.ini</code> file's <a href="http://www.php.net/manual/en/ini.core.php#ini.memory-limit" rel="nofollow">memory_limit</a> setting.</p>
  
  <p>Populating 5,000 models is going to take a significant amount of memory.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-19T23:34:15.127Z
Answers.LastActivityDate: 2016-08-19T23:34:15.127Z
Answers.UserDisplayName: Brad Bell
Body: <p>I am retrieving a data set with about 5000 records and I am using the <code>EntryModel::populateModels($results)</code> to populate the model, this is causing a 500 error. When I limit the number of records returned to 100, it is working fine but when i set the limit to null it throws the error.</p>
  
  <p>There isnt any error logged in the logs, and nor can it be a timeout because it only takes about 5 secs to return the error.</p>
  
Tags: <plugin-development><error-message>
Title: EntryModel::populateModels throws a 500 error
ThreadText: # EntryModel::populateModels throws a 500 error
  
  (Asked by: username_0 on 2016-08-19)
  
  I am retrieving a data set with about 5000 records and I am using the `EntryModel::populateModels($results)` to populate the model, this is causing a 500 error. When I limit the number of records returned to 100, it is working fine but when i set the limit to null it throws the error.
  
  There isnt any error logged in the logs, and nor can it be a timeout because it only takes about 5 secs to return the error.
  
  **Tags:** plugin-development, error-message
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-08-19. Score: 2 | Accepted answer
  
  There's probably an error in `craft/storage/runtime/logs/phperrors.log` and there's a 99% chance the problem is you're hitting your `php.ini` file's [memory\_limit](http://www.php.net/manual/en/ini.core.php#ini.memory-limit) setting.
  
  Populating 5,000 models is going to take a significant amount of memory.
  
  
  ---
  
  