How to update Drupal core or modules with Composer on low memory VPS

If you are interested in this topic and you want to get translated article please let me know in Discuss comments bellow.

Composer needs a lot of RAM, but usually we do not have enough on production VPS. How to solve it?