How to limit RAM usage size

Hello.
study sample. 1.2gb:

When i upload it docker stats shows from 3gb to 8gb ram usage. When it reaches 8gb docker container crashes, because pc has only 8 gb RAM.
I set MALLOC_ARENA_MAX=1 but it didn’t help

If you have limited RAM memory, increase swap size and set these properties in docker compose:

services:
  orthanc:
    image: orthancteam/orthanc:24.8.3
    mem_limit: 7g
    memswap_limit: 32g

You can inspect RAM and swap usage by:

docker inspect -f '{{.State.Pid}}' your_container_id
top -p pid_from_above
1 Like