jvm memory config in cloud foundry

本文详细介绍了如何配置OpenJDK JRE来优化Java运行时环境,包括选择版本、配置文件参数、调整内存大小和权重,以及理解内存计算过程。通过合理的配置,可以提高应用性能和资源利用效率。
OpenJDK JRE

The OpenJDK JRE provides Java runtimes from the OpenJDK project. Versions of Java from the 1.6, 1.7, and 1.8 lines are available. Unless otherwise configured, the version of Java that will be used is specified in config/openjdk.yml.

Detection CriterionUnconditional
Tagsopenjdk=?version?

Tags are printed to standard output by the buildpack detect script

Configuration

For general information on configuring the buildpack, refer to Configuration and Extension.

The JRE can be configured by modifying the config/openjdk.yml file. The JRE uses the Repository utility support and so it supports the version syntax defined there.

NameDescription
repository_rootThe URL of the OpenJDK repository index (details).
versionThe version of Java runtime to use. Candidate versions can be found in the listings for centos6, lucid, mountainlion, and precise. Note: version 1.8.0 and higher require the memory_sizes and memory_heuristics mappings to specify metaspace rather than permgen.
memory_sizesOptional memory sizes, described below under "Memory Sizes".
memory_heuristicsDefault memory size weightings, described below under "Memory Weightings.

Memory

The total available memory is specified when an application is pushed. The Java buildpack uses this value to control the JRE's use of various regions of memory. The JRE memory settings can be influenced by configuring the memory_sizes and/or memory_heuristics mappings.

Note: if the total available memory is scaled up or down, the Java buildpack does not re-calculate the JRE memory settings until the next time the appication is pushed.

Memory Sizes

The following optional properties may be specified in the memory_sizes mapping.

NameDescription
heapThe maximum heap size to use. It may be a single value such as 64m or a range of acceptable values such as 128m..256m. It is used to calculate the value of the Java command line options -Xmx and -Xms.
metaspaceThe maximum Metaspace size to use. It is applicable to versions of OpenJDK from 1.8 onwards. It may be a single value such as 64m or a range of acceptable values such as 128m..256m. It is used to calculate the value of the Java command line options -XX:MaxMetaspaceSize= and -XX:MetaspaceSize=.
permgenThe maximum PermGen size to use. It is applicable to versions of OpenJDK earlier than 1.8. It may be a single value such as 64m or a range of acceptable values such as 128m..256m. It is used to calculate the value of the Java command line options -XX:MaxPermSize= and -XX:PermSize=.
stackThe stack size to use. It may be a single value such as 2m or a range of acceptable values such as 2m..4m. It is used to calculate the value of the Java command line option -Xss.
nativeThe amount of memory to reserve for native memory allocation. It should normally be omitted or specified as a range with no upper bound such as 100m... It does not correspond to a switch on the Java command line.

Memory sizes together with memory weightings (described in the next section) are used to calculate the amount of memory for each memory type. The calculation is described later.

Memory sizes consist of a non-negative integer followed by a unit (k for kilobytes, m for megabytes, g for gigabytes; the case is not significant). Only the memory size 0 may be specified without a unit.

The above memory size properties may be omitted, specified as a single value, or specified as a range. Ranges use the syntax <lower bound>..<upper bound>, although either bound may be omitted in which case the defaults of zero and the total available memory are used for the lower bound and upper bound, respectively. Examples of ranges are 100m..200m (any value between 100 and 200 megabytes, inclusive) and 100m.. (any value greater than or equal to 100 megabytes).

Each form of memory size is equivalent to a range. Omitting a memory size is equivalent to specifying the range 0... Specifying a single value is equivalent to specifying the range with that value as both the lower and upper bound, for example 128m is equivalent to the range 128m..128m.

Memory Weightings

Memory weightings are configured in the memory_heuristics mapping of config/openjdk.yml. Each weighting is a non-negative number and represents a proportion of the total available memory (represented by the sum of all the weightings). For example, the following weightings:

memory_heuristics:
  heap: 15
  permgen: 5
  stack: 1
  native: 2

represent a maximum heap size three times as large as the maximum PermGen size, and so on.

Memory weightings are used together with memory ranges to calculate the amount of memory for each memory type, as follows.

Memory Calculation

The total available memory is allocated into heap, Metaspace or PermGen (depending on the version of OpenJDK), stack, and native memory types.

The total available memory is allocated to each memory type in proportion to its weighting. If the resultant size of a memory type lies outside its range, the size is constrained to the range, the constrained size is excluded from the remaining memory, and no further calculation is required for the memory type. If the resultant size of a memory size lies within its range, the size is included in the remaining memory. The remaining memory is then allocated to the remaining memory types in a similar fashion. Allocation terminates when none of the sizes of the remaining memory types is constrained by the corresponding range.

Termination is guaranteed since there is a finite number of memory types and in each iteration either none of the remaining memory sizes is constrained by the corresponding range and allocation terminates or at least one memory size is constrained by the corresponding range and is omitted from the next iteration.

六自由度机械臂ANN人工神经网络设计:正向逆向运动学求解、正向动力学控制、拉格朗日-欧拉法推导逆向动力学方程(Matlab代码实现)内容概要:本文档围绕六自由度机械臂的ANN人工神经网络设计展开,详细介绍了正向与逆向运动学求解、正向动力学控制以及基于拉格朗日-欧拉法推导逆向动力学方程的理论与Matlab代码实现过程。文档还涵盖了PINN物理信息神经网络在微分方程求解、主动噪声控制、天线分析、电动汽车调度、储能优化等多个工程与科研领域的应用案例,并提供了丰富的Matlab/Simulink仿真资源和技术支持方向,体现了其在多学科交叉仿真与优化中的综合性价值。; 适合人群:具备一定Matlab编程基础,从事机器人控制、自动化、智能制造、电力系统或相关工程领域研究的科研人员、研究生及工程师。; 使用场景及目标:①掌握六自由度机械臂的运动学与动力学建模方法;②学习人工神经网络在复杂非线性系统控制中的应用;③借助Matlab实现动力学方程推导与仿真验证;④拓展至路径规划、优化调度、信号处理等相关课题的研究与复现。; 阅读建议:建议按目录顺序系统学习,重点关注机械臂建模与神经网络控制部分的代码实现,结合提供的网盘资源进行实践操作,并参考文中列举的优化算法与仿真方法拓展自身研究思路。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值