I have a process running that renders a PDF to PNGs and attaches those PNGs to a file field. There is one PDF's results per node, but there we have a bunch of PDFs with 10,000+ pages. We've found that this results in the operation of loading an edit form to eat quite a lot of memory (a node with 12,000 attached files ate up all 4GB of RAM on our server before Apache killed the process for taking up too much memory).

Does anyone have any ideas how we might prevent the field from loading? It looks like I could hack file_field_load() to not perform its task given the user is on an edit page and the troubled field is expected but it would be cool if there was a solution that wasn't a hack.

The stack trace when the troubled field is set to not display is:
1. {main}() /index.php:0
2. menu_execute_active_handler() /index.php:18
3. call_user_func_array() /includes/menu.inc:348
4. node_page_edit() /includes/menu.inc:0
5. drupal_get_form() /modules/node/node.pages.inc:15
6. drupal_process_form() /includes/form.inc:121
7. form_builder() /includes/form.inc:406
8. form_builder() /includes/form.inc:930
9. form_builder() /includes/form.inc:930
10. _form_builder_handle_input_element() /includes/form.inc:889
11. imagefield_widget_value() /includes/form.inc:1020
12. filefield_widget_value() /sites/all/modules/contrib/imagefield/imagefield_widget.inc:207
13. field_file_load() /sites/all/modules/contrib/filefield/filefield_widget.inc:215
14. _field_file_cache() /sites/all/modules/contrib/filefield/field_file.inc:51

And when the field is set to display:
1. {main}() /index.php:0
2. menu_execute_active_handler() /index.php:18
3. call_user_func_array() /includes/menu.inc:348
4. node_page_edit() /includes/menu.inc:0
5. drupal_get_form() /modules/node/node.pages.inc:15
6. drupal_process_form() /includes/form.inc:121
7. form_builder() /includes/form.inc:406
8. form_builder() /includes/form.inc:930
9. form_builder() /includes/form.inc:930
10. form_builder() /includes/form.inc:930
11. _form_builder_handle_input_element() /includes/form.inc:889
12. process_weight() /includes/form.inc:1063

Comments

R.J. Steinert’s picture

R.J. Steinert’s picture

R.J. Steinert’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.