This container runs fine on Docker on my laptop, but crashes with java.lang.OutOfMemoryError: Java heap space when run in Kubernetes. Why?
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mem-eater
spec:
template:
metadata:
labels:
# Refer to this name when defining a service.
app: mem-eater
spec:
containers:
# This is the docker image on your docker registry. This one is on
# the official Docker registry.
- image: neilhwatson/memory-eater:prod
name: mem-eater
It tried setting resource limits and requests, and JVM Xmx limits, but in all cases the crash is exactly the same.
Other info:
- Using Java 9 64bit
- k8s 1.8.8 installed on AWS using kops.
- Docker CE 17.12