Normally the URL for viewing module permissions is something like

/#overlay=admin/people/permissions%23module-comment

When Theme Developer is enabled, this gets redirected to:

/admin/people/permissions?#module-comment

which comes up blank.

I'm seeing this error in my apache error log:

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 5579608 bytes) in /drupal.local/sites/all/modules/devel_themer/devel_themer.module on line 555, referer: http://drupal.local/

Comments

kingfisher64’s picture

Priority: Major » Critical

Not only the permissions page but the content node page. All my articles disappear once this mod is installed and re-appear once uninstalled!

It breaks the system. Ouch.

kenneth.venken’s picture

Title: Permissions page is blank when Theme Developer is enabled » Improve memory usage of theme developer: Permissions page is blank when Theme Developer is enabled
forestmars’s picture

So memory hungry Theme Developer SimpleHTMLDom is.

bmateus’s picture

Same thing here.

Maybe the usage of the simplehtmldom module is eating too much memory, or doesn't have enough time to operate (Issue http://drupal.org/node/1647630#comment-6490230)?

The only way I could install this module was by having 256 MB of PHP memory and explicitly setting "max_execution_time = 60" on my php.ini file (in Drupal's root instalation directory).

I must say that my memory error was not from the Theme Developer module, but from the "simplehtmldom" module.
However, the error only came up when I tried to activate the Theme Developer module...

Update: didn't install the module - system sayd it was, but wasn't true...

kenneth.venken’s picture

Status: Active » Needs work

It would be great if someone could improve the simplehtmldom parser: http://simplehtmldom.sourceforge.net/

arnisraido’s picture

I have the same issue.
With enabled Devel, simplehtmldom and Theme developer, when I turn on Display page timer in Devel module - I get WSOD.

[Sat Mar 02 17:21:45 2013] [error] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 2 bytes) in /home/www/sites/all/modules/simplehtmldom/simplehtmldom/simple_html_dom.php on line 686

When "Display Page timer" is off, then everything works fine.

kenneth.venken’s picture

I've identified two big sources for the memory usage in theme developer. The first is the simplehtmldom parser:

function devel_themer_inject_markers($html, $marker) {
  ...
  $html_dom = new simple_html_dom();
  ...
  $html = (string)$html_dom;
  // Release memory.
  $html_dom->clear();
  unset($html_dom);

  return $html;
}

and the second is the global array containing all the variables.

function devel_themer_catch_function() {
   ...
   $GLOBALS['devel_theme_calls'][$key] = array(
      ...
    );
   ...
    $GLOBALS['devel_themer_server'][$key] = array(
      ...
    );
}

So i've done some tests on the memory usage of theme developer for the permission page (about 100 permissions). All tests are run after a cache clear. These are the results:

Without devel_themer: 27151632 bytes needed.
   With devel_themer: 45196608 bytes needed.
   ... simplehtmldom disabled:        44631648 bytes needed.
   ... no global storage:             35999888 bytes needed.
   ... no globals & no simplehtmldom: 28128008 bytes needed.

I think it's best to focus our efforts on finding a way to eliminate the need for the global array before we move on to fixing simplehtmldom..

bharata’s picture

What's the current status with this issue? As soon as I enable this module (after 1st enabling simplehtmldom) the modules page cannot reload, it just hangs for a long time then displays WSOD. Most other admin pages are also dead. Thankfully the front end does not die and the option "Disable all developer modules" is avaiable in my menu. That get's the site working again. My other trick is to have two pages open to the modules page and use the one that's not gone all white to choose "save configuration" with this module NOT selected.

If there is a good way to safely use this module I would love to here about it.

Is

having 256 MB of PHP memory and explicitly setting "max_execution_time = 60"

an adequate approach?

Thanks for the guidance!!

bharata’s picture

I would like to repot that implementing "max_execution_time = 60" makes the module workable for me.

Hope that helps someone else...