Swap memory for container

Hi guys, please assis me here,
leat assume ,i have a linux with 7gb of ram , i have a container running /
if i need to assisgn swap memory to my container ,

  1. do i need to set in my linux box , like swapon …
    2)or i need to set as docker update --memory --memory swap ?
    out of these which is the recommended type

hello 2,

Can you stop your container ?
In that case, you can start it again with --memory-swap flag to assign the swap.

Best regards,
Fouscou

Hi Fouscou
thanks for your reply ,
let me rephrase my question .
physical machine ram is 7gb
i set docker memory to 2 gb .

Now if i run a java process indide the docker , will it use the physical ram or the docker ram ?
i am sure it uses docker ram .

But need a confirmation .

Hi 2724,
Thanks for reply.
Read this blog post to confirm https://developers.redhat.com/blog/2017/03/14/java-inside-docker/