How to Modify Available Memory for BitBucket Pipeline Scans
In some cases, you may need to increase the memory available to build and scan your project using the Mend for Bitbucket Pipeline integration. When doing so, pipeline resources will need to be allocated towards the build service. You can configure a service to use anywhere from 128 to 3072 MB (or 7128 MB for 2x builds) of memory. This allows you to dedicate less memory to services and more to the build space as required. The below steps will allow users to modify the allocated memory in a yaml file.
Out Of Memory Error
The following error in the scan log may indicate that you need to increase the memory available to the build space: “error waiting for container: unexpected EOF”
Instructions
The example below uses a docker container with a memory requirement of 4GB where 4GB = 4096MB.
Changes should be made in the “bitbucket-pipelines.yml” file.
Add in the following bolded parameters to the .yml file:
image: ...……
options:
docker: true
size: 2x
pipelines:
branches:
branches:
master:
step:
caches:
....
services:
- docker
definitions:
services:
docker:
memory: 4096
Increasing the memory value will allow more memory to automatically allocate to the Build service and prevent scan failures.