Token's available "Replacement patterns" nested table should only be displayed on-demand The Token module provides hooks to other modules to serve their own tokens. Multiple modules that support Token integration can generate a really huge nested table tree when displaying the available tokens in the field settings:



This can lead to out-of-memory issues in Views settings or regular field settings:





Earlier I created an issue related to this problem: http://drupal.org/node/1836264. Until a possible solution comes there (e.g. a patch), I would like to solve it my own (it doesn't matter if I temporarily have to "hack" Token's core): I would only like to load this table with the available tokens "on-demand" with AJAX or any other possible solution.

Do you have any ideas how to solve this?
The default token tree can contain many thousands of lines of HTML, and the corresponding Javascript listeners and functionality can totally break things memory wise (or just give you a darn laggy experience). Plus it can confuse the heck out of site administrators.

These issues refer to current developments for loading the token tree 'on demand' or via a popup:  


http://drupal.org/node/1684984 
http://drupal.org/node/1229568


And OP pointed out in his comments, the Token tweaks module lets you set a depth limit for the token tree, which seems to have solved his memory problem.