Spring Cloud-developed microservices deployed to Linux on high memory issues

Source: Internet
Author: User

"Problem description"

One of the most serious resource problems in using Spring cloud is the high memory footprint, and the fact that there is not a large amount of development testing, or even a problem with the service not being properly accessed.

"Cause analysis"

The main reason is that when a single micro-service from spring Cloud is deployed on a Linux system server, the memory consumed on a Linux system computer with 8G of memory reaches around 1G. With only 5 or so micro services deployed, the memory is not enough.

There are a lot of ways to see it on the web, and many people suggest that the JVM's parameters are set on Eclipse or idea:

However, the actual deployment validation found that there was no effect.

Root cause: Because of the startup parameters of the Spring-boot project, the jar package generated by spring boot is an ordinary jar package;
The JVM parameters of this jar package must also be set from the Java-jar command, which sets the memory consumption to the maximum minimum and the initial value to be useful.


"Solutions"

On Linux system servers, when launching each spring cloud microservices jar, you need to increase the JVM's memory parameter settings in the middle of java-jar commands:-xms64m-xmx128m

nohup java -xms64m-xmx128m -jar Xxx.xxxx-xxx-xxxxxx-0.0.1-snapshot.jar &

Spring Cloud-developed microservices deployed to Linux on high memory issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.