Craft 3 uses Composer behind the scenes to perform updates (for both Craft and plugins). Composer tends to be memory hungry. If your php.ini file's memory_limit is set to 128M or less, there's a good chance you'll hit a fatal memory error that looks similar to this:
Status: Internal Server Error
Response: <pre>PHP Fatal Error 'yii\base\ErrorException' with message 'Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)'
in /website/vendor/composer/composer/src/Composer/SomeComposerClass.php
Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleFatalError()
#1 {main}</pre>
Your options are to bump your php.ini file's memory_limit setting to 256M (or 512M depending on environmental configurations), which some hosts might not allow or to run composer update from the command line for that site, which might be inconvenient and/or not practical.
What you're there, you'll probably want to bump the max_execution_time as well.
Ideally Craft 3 should be able to run updates from the Control Panel on 128M of memory.
If I may add to this, since I just stumbled across the same error - it would be nice if composer errors would be caught and presented in a less technical (or maybe just more destinct) way. There are some common, well-known error cases like out of memory where a short message might be more helpful.
In this case, that might be "Updates could not be installed due to PHPs memory_limit configuration option being set too low. Increase it in your php.ini or check with your host. Click here for more information on how to solve this issue."
This commit for the next release (along with some web service API changes on our end) has decreased both Composer memory and execution time by roughly 2/3 in our tests for an average plugin install/update. Craft updates won't see such a dramatic improvement, but there will be some. Closing for now, but will re-open if things don't play-out like we expect.
Most helpful comment
If I may add to this, since I just stumbled across the same error - it would be nice if composer errors would be caught and presented in a less technical (or maybe just more destinct) way. There are some common, well-known error cases like out of memory where a short message might be more helpful.
In this case, that might be "Updates could not be installed due to PHPs
memory_limitconfiguration option being set too low. Increase it in yourphp.inior check with your host. Click here for more information on how to solve this issue."