I get an error "PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 91 bytes) in /var/www/htdocs/ecogen1/html/sites/includes/cache.inc on line 434" when simply publishing a single node through VBO.
It appears even before the confirmation page.

As soon as I give moderators the permission "Bypass content access control" the error disappears.

Access control on our site is handled by Organic Groups (without OG access control module) and Domain access (without Domain access strict module)

Is it normal that VBO used such an impressive amount of memory?
Any way to change this?

Comments

bojanz’s picture

Project:Views Bulk Operations (VBO)» Organic groups
Version:7.x-3.1» 7.x-2.x-dev
Component:Core» og.module
Issue summary:View changes

No, VBO isn't the problem here. I myself have never seen such a memory breach on regular installs.
Either there's a OG / Domain Access bug that's causing them to use too much memory, or you just have too many modules installed.

Let's ask Amitai and the rest of the OG team whether they have any tips to share.
Otherwise you'll have to debug it yourself (xhprof to see where the memory is going).

joel_osc’s picture

I am experiencing the exact same issue. I did some checking and unfortunately could not isolate the issue beyond what looks like a large number of calls to og_is_group:

function og_is_group($entity_type, $entity) {
  $wrapper = entity_metadata_wrapper($entity_type, $entity);
  $bundle = $wrapper->getBundle();

  if (!field_info_instance($entity_type, OG_GROUP_FIELD, $bundle)) {
    return variable_get("og_is_group__{$entity_type}__{$bundle}", FALSE);
  }
  return !empty($wrapper->{OG_GROUP_FIELD}) && $wrapper->{OG_GROUP_FIELD}->value();
}

For testing purposes I changed the above code to:

function og_is_group($entity_type, $entity) {
  $wrapper = entity_metadata_wrapper($entity_type, $entity);
  $bundle = $wrapper->getBundle();

  if (!field_info_instance($entity_type, OG_GROUP_FIELD, $bundle)) {
    return variable_get("og_is_group__{$entity_type}__{$bundle}", FALSE);
  }

  $tmp = $wrapper->{OG_GROUP_FIELD}->value();
  return TRUE;
  //return !empty($wrapper->{OG_GROUP_FIELD}) && $wrapper->{OG_GROUP_FIELD}->value();
}

With this code in place I get the memory exhaustion error. If I comment out the $tmp line I added then the VBO operation completes successfully. So, to me the issue could be a non-optimal code path in og causing a lot of hits to the entity wrapper, or the entity wrapper using too much memory per hit or something else I am missing completely which is quite possible. Maybe some wiser folks from the community can shed some light on this.

A workaround to this was to add a pager to the view which keeps the memory consumption below the php limit. On an interesting note the problem seems to be dependent on the number of items in the view and not the number of items selected for a VBO action - I was selecting one item for deletion during testing.