How limit the usage of cup and memory when use drone build

When a build process happening,the cup and memery all ways 100% load,how to prevent this,can we do some limit via drone?

@vkiller,

If you are using kubernetes runner you can set limit as below:
https://docs.drone.io/pipeline/kubernetes/syntax/steps/#resources

And for docker runner you can use something like below:
kind: pipeline
type: docker
name: default

steps:
- name: build
  image: golang
  detach: false
  failure: ignore
  mem_limit: 1GiB
  memswap_limit: 2GiB

Regards,
Harness support

Are you sure drone allow this?

Why there is a error with vscode

And I did a test,using

  mem_limit: 1GiB
  memswap_limit: 2GiB

seems no effect.