swap

it seems that the reason why Docker uses much more memory is that it does not allow the operating system to use virtual memory (swap memory). What I didn't see in the original debugging, is that the python program consumes memory of several GB, but windows has automatically moved another several GB of memory to virtual memory to save RAM space. This is however not enabled in docker environment, so the only RAM available to the docker is the one that is specified in the set up phase.

OperatingSystem:

ProgrammingLanguage:

Subscribe to swap