how to avoid 'out of memory' errors when programmatically generating a lot of nodes in drupal?
- by sprugman
I'm creating about 150 nodes programmatically and running into 'out of memory' errors when doing it all in a single request. (I have a menu callback that generates the nodes and calls node_save() on them.)
Example:
for($i=0; $i<150; $i++) {
$node = new stdClass();
$node->title="Foo $i";
$node->field_myfield[0]['value'] =…