Let me preface by stating that I don’t use a Mac or Docker, so there might be other more well know issues at play for which I’m unaware.
However, memory allotment gets tricky when dealing with containers and VMs. The problem is you’re dealing with the memory allotment on your Host (i.e. Mac), the VM container and then the various things running inside the VM (including the JVM).
So if you gave your Docker container access to 10GBs of RAM, but your Mac only has 16GBs of RAM you could very well be running into swapping issues on your Mac. I know I always have Firefox and multiple instance of Chrome running and Chrome can really eat up memory. You start to add in all the various Developer Tools you might be running (IDE, Photoshop, Database, etc) and you could easily be having swapping issues at your Mac OS level.
Then there’s the Docker container. Not knowing what’s running in your Docker container, they may be enough, maybe it’s overkill or maybe it’s not enough. That seems like a ton, but maybe there’s a bunch of micro services and a database running inside that container that chews up all that memory. Then there’s the JVM memory settings. If those are set higher than the Docker memory settings, that’s going to cause issues. Or maybe the JVM settings are way to low, so it’s forcing a ton of garbage collection and the JVM is fighting memory issues even though the Docker container has plenty of memory available.
So, it may be all of this is fine, but if you haven’t looked things over, it’s worth doing just to make sure you haven’t created a bottleneck somewhere accidentally.