Allowed memory size of xxx bytes exhausted drupal
I have a list of nodes and for the crud operations a created a custom module, so basicly, when you click to a button, it posts some variables to a url with ajax and the custom module executes a drupal_execute function after the form variables.
The problem occured, after the nodes reached the number like 30k, at that point i started to get a fatal error about memory limit. I searched the core and with the help of the firebug Net, i saw that all the elements of the node that i'm trying to create (or edit) and i realized it's because of the node refference field. I set the field as a select list, so when the module try to create a node, thousands of nid's are printed which causes the memory problem. So i configured the field as autocomplete. At this point i started to get another error as "no title has found". So i changed the line in my custom module:
$form_state['values']['field_movie'][0]['nid']['nid'] = $title." [nid:".$_POST['nid']."]";
Now, the memory problem is solved.
