After migrating from Magento 22.214.171.124 to Magento 2.1.7 I needed to resize images. I did with
php_cli bin/magento catalog:images:resize
That throws an exception "Memory limit has been reached" after a while. Studying the web I found that GD2.php is responsible for image manipulation. And I found a hint, that in earlier versions of Magento there was a problem with PHP-cli limit set to -1. But that seem to be fixed in GD2.php of Magento 2.
But where comes the error in Magento 2 from? Can someone explain that to me?