How to pull in dynamic content in hook_filter_FILTER_process? I'm creating a custom input filter to replace a placeholder html comment with a simple form. However, calling drupal_get_form within a hook_filter_FILTER_process function causes the php memory limit to be exceeded. 

Elsewhere I tried to do a node_load within one of these functions and the same thing happened.  I was able to work around that but this indicates it's nothing to do with the form (which is displayed elsewhere on the site anyway, and only contains a couple of fields). 

The memory limit is hit whether I actually perform any filtering or just return the unfiltered text.

Any ideas what I'm doing wrong?

Thanks
Depending on your settings, hook_filter_FILTER_process() will be invoked (albeit in a round-about way) from within the drupal_get_form() and node_load() functions.

So at the moment you're simply creating an infinite loop that PHP cannot escape from (node_load() calls hook_filter_FILTER_process(), which then calls node_load() again), hence the out of memory error.