If you are still facing issues after updating your memory limit then the best thing to try is to run:
composer update --lock
This will update your lock file so that composer can run from it if you have changed your composer.json file.
You can now optimally run:
composer update
or
composer install