JDK 内存过高的动态合并微服务处理方法  

Dynamically merging microservices to reduce jdk memory

在线阅读下载全文

作  者:宋恒嘉 陈洁 仲伟炜 SONG Hengjia;CHEN Jie;ZHONG Weiwei(Bozhi Safety Technology Co.,Ltd,Nanjing,China,210000)

机构地区:[1]博智安全科技股份有限公司,南京210000

出  处:《福建电脑》2022年第6期56-58,共3页Journal of Fujian Computer

摘  要:微服务化改造后,同一套代码在内存充足的集群环境下可以完美运行,但在单机环境下可能会存在内存占用过高的问题。为了解决这种问题,一般采取调整jvm参数的方式进行应对。但是jvm有最低的参数要求,为此可能需要重新编写代码适配内存不足的硬件环境。本文阐述了一种全新的在编译打包时动态合并微服务、动态去除注册中心的方法,用于解决在单机环境下JDK内存占用过高的问题。该方法解决了同一套代码既可以在集群化环境下运行,也可以在内存不足的环境下运行的的问题,在保证功能正常的前提下,将业务中台4个微服务在打包时动态合并为2个微服务,在单机环境下将3G内存占用优化到1.1G左右。After the microservice transformation,the same set of code can run perfectly in the cluster environment with sufficient memory,but the memory may be too high in the single machine environment,In order to solve this problem,we may first adjust the JVM parameters,but the JVM has the lowest parameter requirements.Therefore,we may need to rewrite the code to adapt to the hardware environment with insufficient memory.This paper describes a new method of dynamically merging micro services and dynamically removing the registry center when compiling and packaging.This method solves the problem that the same set of code can run both in the clustered environment and in the environment with insufficient memory.On the premise of ensuring the normal function,four microservices in the service are dynamically combined into two microservices,and the 3G memory is optimized to about 1.1G in the single machine environment.

关 键 词:共享JDK 内存占用 动态合并 微服务 

分 类 号:TP39[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象