Minikube eats RAM like a starving student on ramen night, and sometimes it just needs more.

Let’s see what’s happening. First, check your current Minikube VM’s memory allocation:

minikube config get memory

If that output is, say, 2048 (meaning 2GB), and your resource-heavy app is complaining about OOM (Out Of Memory) errors or just generally being sluggish, it’s time to crank it up.

To increase the memory allocated to your Minikube VM, use the minikube config set memory command. Let’s say you want to give it 8GB:

minikube config set memory 8192

This command tells Minikube to reserve 8192MB (8GB) of your host machine’s RAM for the virtual machine it runs. After setting this, you’ll need to restart your Minikube cluster for the changes to take effect:

minikube stop
minikube start

The minikube start command will provision a new Minikube VM with the updated memory configuration. This gives your Kubernetes nodes within the Minikube VM more memory to work with, allowing your applications to allocate more resources and run without hitting memory limits.

What if you’re running other demanding applications on your host machine alongside Minikube? You might run into general host system OOM issues. The fix here isn’t directly with Minikube’s config, but rather managing your host’s resources. Identify which other processes are consuming the most RAM on your operating system and consider reducing their memory footprint or stopping them temporarily. For example, on Linux, top or htop will show you memory usage per process. On macOS, Activity Monitor serves the same purpose.

Sometimes, the issue isn’t the total allocated memory, but how it’s being requested by your pods. Check your Kubernetes deployment or pod YAML files for resources.limits.memory and resources.requests.memory. If these are set too low, your pods might not be able to get the memory they need even if the Minikube VM has plenty. For instance, if you have a pod with resources.requests.memory: 512Mi and resources.limits.memory: 1024Mi, and your Minikube VM only has 2GB of RAM, running several such pods could quickly exhaust available memory. You’d need to adjust these values to be more realistic for your application’s needs, but not exceeding the total memory available to the Minikube VM.

Consider the overhead of the Kubernetes components themselves. kubelet, containerd (or Docker), and other control plane components running inside the Minikube VM also consume memory. If you’ve set your Minikube memory very close to the minimum required for your applications, these system processes might cause the VM to run out of memory. It’s often prudent to leave a buffer of 1-2GB for the VM’s operating system and Kubernetes components.

If you’re using a specific driver for Minikube (like Docker, VirtualBox, or HyperKit), the underlying VM configuration for that driver might have its own memory limits. While minikube config set memory usually handles this, in rare cases, you might need to delve into the specific driver’s settings. For example, if using VirtualBox directly, you might check the VM settings in the VirtualBox GUI. However, the minikube config commands are designed to abstract this away.

Finally, if you’ve increased memory and are still facing issues, it’s worth checking for memory leaks in your application itself. Tools like pprof for Go applications or Python’s memory_profiler can help identify if your application is consuming an ever-increasing amount of memory over time, which would require code changes rather than just increasing VM memory.

The next error you’ll likely encounter after fixing memory issues is related to disk space, as Minikube’s virtual disk can also become a bottleneck.

Want structured learning?

Take the full Minikube course →