Trying to build a tree menu with 6.x-6.4 under Drupal 6.13 for a vocabulary with 1296 top-level terms and a combined total of 1575 pairings of top-level and second-level terms (most of which have multiple parents), the module exhausts memory and blows up with an error like the following:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16 bytes) in /home/tammanyt/public_html/dr6_test/includes/theme.inc on line 580

Trying to edit the resulting tree menu (or what there is of it after the build error) results in a similar error. Since the resulting menu cannot be edited, it cannot be deleted in the normal way, requiring that the module be disabled and uninstalled, which of course deletes all other tree menus that have been created.

I have bumped memory up to 128MB without success but don't want to go any higher because I think that will probably get me in trouble with my provider, especially if that much memory is used frequently.

Is there a solution to this problem, other than breaking the vocabulary up into smaller tree menus?

Comments

rcrowther’s picture

Straight talking, I don't know. I've got no performance profile tools, not through want of trying, I might add. Since we've bumped into a limit here, I'll try and get some sort of profiling installed (I am interested in this issue, of how much the module can handle, how much it COULD handle).

Code optimization is the only real fix I can think of, though.

rcrowther’s picture

Assigned: Unassigned » rcrowther

Now got some working tools, mainly a profiler. News soon I hope.

One initial result suggests that the problems may relate more to the building of menus, i.e. once up and running the menu is fine. I'll look to see where these problems are and if I can spread the load (staged building, for example). Rob.

philpro’s picture

I second this bug report:
Fatal error: Allowed memory size of 146800640 bytes exhausted (tried to allocate 24 bytes) in /var/www/pb/directory/includes/common.inc on line 2943

I am trying to build a large menu - which fails.

Thanks,

rcrowther’s picture

On a basic level, we need to break down treebuilding so it can handle - what? If posters can give an idea of the number of terms that might be handy in the future. OK - I see BayouBill has done this!

Treemenu ought to handle a thousand terms, as that may reasonably be what can go on a page now we have expanding menus.

Originally Treemenu was designed to make little menus, a sort of super-compatible very flexible indexer. But it seems all sorts of users are keen on using it to index mid-sized sites in their entirety. BayouBill has elsewhere raised this as a, um, if I might use the word, 'philospohical' concern.

If anyone is in a generous mood, try this - build your supersized menu by starting with a small depth, say 2. then try extending in stages to full depth, and see if you can get there? Bear in mind what I saw above - the menu should be very capable once up and running.

rcrowther’s picture

I have performace tools now. Actually, the solution for the current code is to use a batch builder, as Taxonomy Menu has done. But I feel this is probably a waste of effort, as there are better ways. Depends on your needs?