1) Installed drupal 5.1 + views 5.x-1.6-beta5
2) PHP memory_limit set to 16M (Internet provider preset; cannot change).
3) After installing Views module PHP uses too much memory. Fatal error: Allowed memory size of 16777216 bytes exhausted in /customers/liljeholmensfolkhogskola.se/liljeholmensfolkhogskola.se/httpd.www/modules/views/views_cache.inc on line 73

An easy way to solve this would, of course, to set PHP memory_limit to 32M, but it is a problem that Views uses so much memory. It makes the drupal + views module not working on many "Web hotels". PHP memory_limit set to 16M is quite a common limit. If this could not be optimized, it must be much clearer that Views will not work unless at least 32M memory limit on the PHP.

Thanks/
Carl Carlstein

Comments

nancydru’s picture

I have sites at 8M and Views works on them. But then I don't have any realy complex Views.

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

What other modules do you have? Views can use a bit of memory, but the amount of memory that's really used is a combination of the whole site's worth of modules, plus the modules you're using that utilize Views.

It's been found that lots of CCK fields really crank up the amount of memory that gets used. This is partly a flaw in Views, but it's not natively Views using that memory.

kalle’s picture

Thanks for your replies.

I use CCK + Views. So CCK is part of the problem. But isn't there any optimization that could be done from in View to solve the View-part of this problem?

Thanks,
Carl

dvsouza’s picture

Component: Code » Miscellaneous
jarea’s picture

I too am getting allowed memory exhausted, but not on a consistent basis. I can replicate it most reliably when I try to edit forums in admin/content/forum, where it occurs about every other time I load the page, but I also get it on admin/build/modules and perhaps some other places. I suspect something is flying off the wheel somewhere in views_cache.

PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 695222 bytes) in /home/virtual/site100/fst/var/www/html/sfn/modules/views/views_cache.inc on line 146, referer: http://www..net/sfn/?q=admin/content/forum/edit/forum/162

Looking at the page source, I do note that there is a block view on the page, it's export is listed below

  $view = new stdClass();
  $view->name = 'view_articles';
  $view->description = 'View the latest submitted articles';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'News Articles';
  $view->page_header = '';
  $view->page_header_format = '4';
  $view->page_footer = '';
  $view->page_footer_format = '4';
  $view->page_empty = '';
  $view->page_empty_format = '4';
  $view->page_type = 'teaser';
  $view->url = 'view/articles';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '25';
  $view->block = TRUE;
  $view->block_title = 'Latest News Articles';
  $view->block_header = '';
  $view->block_header_format = '4';
  $view->block_footer = '';
  $view->block_footer_format = '4';
  $view->block_empty = '';
  $view->block_empty_format = '4';
  $view->block_type = 'list';
  $view->nodes_per_block = '5';
  $view->block_more = TRUE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
    array (
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'sortable' => '1',
      'options' => 'link',
    ),
    array (
      'tablename' => 'node',
      'field' => 'created',
      'label' => '',
      'handler' => 'views_handler_field_date_small',
      'sortable' => '1',
      'defaultsort' => 'DESC',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'term_node_9',
      'field' => 'tid',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => '69',
),
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node, term_node_9);
  $views[$view->name] = $view;

This is the version info on my views module:

; $Id: views.info,v 1.2.2.4 2007/06/18 23:07:13 dww Exp $
name = Views
description = The views module creates customized views of node lists.
package = Views

; Information added by drupal.org packaging script on 2007-07-14
version = "5.x-1.6"
project = "views"
datestamp = "1184451606"

Hope this might help.

catch’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

duplicate of this: http://drupal.org/node/83490