Sonarcloud Bitbucket pipline failing due to exceeded memory limit

This issue is resolved.
The problem was not in the amount of memory for the step itself…
It was for the Docker process. By default, it is allocated only 1024 MB or memory and for some reason that is not enough in this case. I am not sure why though, but the following link explains how to increase Docker memory
https://confluence.atlassian.com/bitbucket/run-docker-commands-in-bitbucket-pipelines-879254331.html#RunDockercommandsinBitbucketPipelines-Dockermemorylimits

3 Likes