Imagine you would run a bunch of services say based on the same Tomcat image.
Would Docker optimize memory usage for identical memory segments and reuse these patterns?
DevOps Stack Exchange is a question and answer site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure. It only takes a minute to sign up.
Sign up to join this communityThis question is discussed in some detail in issue 7950 The conclusion seems to be that:
Depending on your storage configuration, the kernel page cache may be used if multiple containers are accessing the same file (e.g., see OverlayFS and Docker Performance).
You may be able to enable Kernel same-page merging through use of of the ksm_preload tool.