I run several microservices (Spring Cloud + Docker) on small / medium machines on AWS, and recently I found that these machines are often exhausted and require a reboot. I am studying the causes of this power loss, thinking about possible memory leaks or incorrect configurations on the instance / container.
I tried to limit the amount of memory that these containers can use:
docker run -m 500M --memory-swap 500M -d my-service:latest
At the moment, my service (a standard spring cloud service with one single endpoint that writes material to Redis DB using spring-data-redis) has not even started.
The memory was increased to 760M , and it worked, but, controlling it with the help of the docker, I see that the minimum:
CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS cd5f64aa371e 0.18% 606.9 MiB / 762.9 MiB 79.55% 102.4 MB / 99 MB 1.012 MB / 4.153 MB 60
I added some parameters to limit the heap of JVM memory, but it doesn’t seem to reduce it very much:
_JAVA_OPTIONS: "-Xms8m -Xss256k -Xmx512m"
I run
- Spring Cloud Brixton.M5
- Spring Download 1.3.2
- Java 8 (Oracle JVM)
- Docker
- Spring Redis 1.7.1 data
Is there a reason why such a simple service uses so much memory to run? Are there any features that I should disable to improve this?
source share