I believe the problem is in the way Drupal allocates memory for php, or vice versa -but this is only a theory.
I see that the problem has existed for years and is prevalent also in Wordpress. The error message: *Fatal error*: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16142054 bytes) in */var/www/html/mysite/includes/database/database.inc* on line *2139*....Is quite curious.
It varies in file name and amount tried to allocate but remarkably the the error message: *Fatal error*: Allowed memory size of 134217728 bytes exhausted is identical in all cases, is it hard coded somewhere?
There is a workaround. Right at the very end of settings.php include one line: ini_set('memory_limit','-1'); This overrides PHP settings for the particular Drupal install.
Maybe Drupal aficionados and coders could attend to this before Drupal gets to Ver 8