cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Swap support for Cloud Foundry BTP?

Andrew_Mai
Participant
0 Kudos

Hi SAP Experts,

I'm using docker for deployment my Node.js App on SAP BTP Cloud Foundry. We having trouble with the memory issues. My App will sometime having issues processing large data, which will lead to 137 Out of memory error. But we can't assign more memory to this service.

I'm looking to enable the memory swap for my docker:

https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details

But when I try to enable the memory swap, I get this warning:

WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.

Is there a way to enable this capabilities on Cloud Foundry Enviroment?

Accepted Solutions (0)

Answers (1)

Answers (1)

gregorw
Active Contributor
0 Kudos

Have you set the environment variable NODE_OPTIONS to --max_old_space_size=8192 to allow Node.js to actually use the memory? Any special reason why you use docker instead of the Node buildpack?

Andrew_Mai
Participant
0 Kudos

Hi gregor.wolf ,

We use docker to prepare for the Kyma Runtime. The issues is that we can only assign a limited memory for this service (For example, 768MB). Most of the time, the service only need 200-300MB. But for some very special case, we will have a very big payload, the memory will go over 768MB limit, and crash. If we assign more memory for this service, it will be a waste. That is the reason why I'm looking for other option to save resource, like memory swap.