Active
Project:
Features
Version:
7.x-2.6-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Jun 2015 at 18:53 UTC
Updated:
15 Apr 2016 at 14:09 UTC
Jump to comment: Most recent
As part of the panoply distribution, the features module has been updated to 7.x-2.6-rc1. After the update, i get a PHP Fatal error when reverting all features via drush fra -y. If I roll back to 7.x-2.5, the issue disappears. The error shows up on my production server only with drush 7.0.0 and PHP 5.3.10 and 256 MB memory limit. Currently i have about 20 custom features installed.
I'm not able to reproduce this error on my local machine with php 5.6.7
Allowed memory size of 268435456 bytes exhausted (tried to allocate 523800 bytes) in /var/www/vhosts/XXXXXX/httpdocs/profiles/XXXXX/modules/contrib/features/features.export.inc on line 1033
Comments
Comment #1
mpotter commentedI could not reproduce this on either my Panopoly instance nor my Open Atrium instance which has more features enabled. Are you using a plain version of Panopoly or do you also have custom features of your own? It might be that one of your custom features is too large.
The recent Features moved some stuff from variables into cache to actually *decrease* memory use. Are you running anything like Memcache to help with this?
Might also just try to boost your memory limit in PHP.ini. Features has always been memory intensive and I typically recommend a setting of 384 MB on development systems that make heavy use of features.
Comment #2
dsnopekLooking at the diff between 2.5 and 2.6-rc1 doesn't show any red flags as far as additional memory use.
There was one commit that's doing stuff with static caches that I don't understand, so it might be worth trying with that patch reverted and see if that fixes the problem: #1988252: Use the same language consistently in generated comments and strings
However, I wouldn't be suprised if that doesn't help - just because it's using static caches and I don't personally understand what's going on, doesn't mean it's doing anything wrong. :-)
A couple other ideas:
drush frawith Features 2.5 and see if you're hitting the limit. If you do, you can try increasing that and see exactly how close you were to the edge.Sorry we don't have an answer for you yet! Hopefully, with a couple experiments we can narrow the problem down. :-)
Comment #3
micbar commentedThank you both mpotter and dsnopek for your quick and thorough answers. I will try 1) and 2) if i find the time. Could be a few weeks until I can share any new findings. For the moment I keep it on 7.x-2.5 because i need a working script for my site deployments.
I suggest to leave this issue active and see if somebody else faces the same problem.
Comment #4
mpotter commentedYou might also want to try the patch in #2497139: Alter hooks causing overrides due to object properties not sorted to see if that solves the problem.
Comment #5
mpotter commentedComment #6
kenorb commentedThe same here:
This happens on:
drush fra -yThe problem is that the limit is already set to 1G, but it needs even more (2G?). OPCache and memcached is already in place.
There is around 86 features in total, but I assume only 10-20 of them are in Overridden state.
Not sure what's the possible solution.
I haven't checked the code, but it seems unlikely that one module could causing it, so maybe some memory should be unset/freed between consecutive module reverts?
Comment #7
kenorb commentedHappened again:
It also crashes when I'm trying to list all my features, so I'm not able to give you exact number, but it could be less than 100.
Allocation of 1G to just load all the features is a huge resource. Especially when I'm doing that within VM which has some already allocated 2G of RAM, so I won't be able to increase it further more.
Note that I'm already using memcached and OPCache for CLI, with XDebug extension disabled including Devel module disabled, so the consumption should be not so large.
It seems line 1100 tried to allocate 1M:
Function: features_remove_recursion() which is part of features_sanitize().
So it sound like something should be optimized.
Comment #8
kenorb commentedSome improvements were done in #2543306: drush_features_list() slow - about 220 seconds, but still some operation on large objects are probably not efficient enough.
Maybe we can free up some memory between each feature or use cache to store some data?
Comment #9
kenorb commentedThis is the test which I did using the following patch and my custom timer functions:
The above checking for memory_get_usage memory usage.
Here is the result of running drush feature-list:
Most of the features consist single entityform_type and several field_group and field_instance entries associated with the form.
I just wondering if that memory needs to increase each time.
Secondly there is a big gap of 0.5G and it's caused by the next checked feature consisting 750 rules. This maybe related to where Rules #2702107: Rules are not reverted using Features. or Features #2701957: Rules deployment breaks, due to overridden rules not recognized could have a broken logic when sanitizing invalid data.
This is after setting entity_rebuild_on_flush variable to FALSE (#2698509: Feature revert of hundreds rules takes hours to complete.).
--
Update: It seems rule feature (750 rules) takes 787 MB in memory + 208 form feature modules takes 443 MB, which gives 1.2GB usage in total.
So it seems the
features_get_storage()function takes almost 1GB in memory only to return single0value?--
Update: I did additional test by actually increasing it to 2GB, and it seems the memory wasn't dropped when rule feature was parsed, e.g.
Could it be PHP bug, since it's not freeing up the memory on time? And actually we can't unset anything in here. I've tried calling gc_collect_cycles() between the storage calls, but it didn't help either.
I've tested above with PHP 5.5.33, in PHP 5.6.20 it seems it's consuming less memory for some reason (354 instead of 787, after I recompiled PHP and added some xdebug, debug symbols, pear, etc. it's 612 - still less).
Comment #10
kenorb commented