- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一台 16GB RAM 的服务器。我试图通过运行来设置容器的内存限制
docker run -it -m 500M <image-name>
在 docker stats 中,显示容器的内存限制为 500MB。但是当我尝试这样做时
docker exec -it <containerID> /bin/sh
并执行“top”,它显示可用内存为 16GB..
不应该设置为500MB吗?
我需要它为 500 MB 的主要原因是我在每个容器中运行 java 应用程序。默认情况下,JVM 将 16gb/64 作为 Xms,将 4gb 作为 Xmx。:(
最佳答案
我认为这篇文章将帮助您理解为什么 free 和 top 在容器内无法正常工作。
Most of the Linux tools providing system resource metrics were created before
cgroups even existed (e.g.: free and top, both from procps). They usually read
memory metrics from the proc filesystem: /proc/meminfo, /proc/vmstat,
/proc/PID/smaps and others.
Unfortunately /proc/meminfo, /proc/vmstat and friends are not containerized.
Meaning that they are not cgroup-aware. They will always display memory
numbers from the host system (physical or virtual machine) as a whole, which
is useless for modern Linux containers
This causes a lot of confusion for users of Linux containers. Why does free
say there is 32GB free memory, when the container only allows 512MB to be
used?
https://fabiokung.com/2014/03/13/memory-inside-linux-containers/
关于java - Docker run -m 没有设置限制(JVM 为 xms 和 xmx 占用了整个主机的大小),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49919657/
我正在尝试为我的应用添加 G+H 解决方案。我已经完成了从 HMS 工具包的转换。但是在转换之后,它给了我关于 xms 导入的错误,它也给了我关于 无法解析配置 ':classpath' 的所有工件。
当我增加 tomcat 上的 -Xms 值时,内存使用(来自 free -m 命令)不会相应改变。下面的示例表明,将其值增加 200MB 只会影响内存使用 ~85MB。 ...usr/lib/jvm/
据我了解,-Xms 和-Xmx 用于指定java 程序的最小和最大堆大小。根据我的理解,如果我们不指定任何选项,JVM 可以工作,即堆大小可以由 JVM 本身管理。 所以,如果我们想限制最大堆大小,我
设置 -Xms 参数有什么好处,例如,初始内存更大,然后默认计算一个(在我的情况下为 64 MB,根据 Java GC 调整: http://java.sun.com/javase/technolog
托管一些 WAR 应用程序的 Ubuntu Server 收到一些堆错误消息,如下所示。该服务器运行 tomcat8 并且运行良好,现在并且没有任何更改代码端服务器出现错误并且 Tomcat 停止。
我正在使用 ${JAVA_HOME}/java -Xms512m 我收到一个错误: --------------------------------------------------- JVMJ9G
我执行以下命令: java -Xms1024M -Xmx1024M mypackage.MyClass 我期望 JVM 立即捕获资源,但实际上我的资源管理器显示 JVM 捕获了 7.2M。 有谁知道是
我有用于 IBM MQ XMS 的发送方和接收方控制台应用程序。发送方填充队列,接收方使用接收方法使队列管理器出队。我正在使用带有 bool 值的 while 循环来继续运行接收器,这样只要队列接收器
对于字符串“aa\nbb\ncc”,我想从左边的最后一个字母到第一个换行符(“a”)到多行字符串的末尾进行匹配,并期望 "aa\nbb\ncc" =~ qr/( . $ .+ )/xms匹配 a\nb
我有一个应用程序使用 WebSphere MQ 通过 WebSphere 将数据发送到云中的数据中心。部分功能是,如果服务器端订阅者检测到 30 分钟内未收到消息,则线程暂停 5 分钟,并删除连接。当
我有一个 XMS MQ 客户端应用程序,它从一系列 MQ 端点提取消息。有某些原因代码可以使进程继续,而对于某些原因代码应该中止。例如,一个端点的 MQRC_Q_MGR_NOT_AVAILABLE 2
运行以下主要方法: public class Test { public static void main(String[] args) { System.out.printl
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: How is the default java heap size determined? 我很好奇如果我不
我有以下 Java 程序,我认为它不需要太多 Java 堆: sleep 测试.java public class SleepTest { public static void main(St
我创建了一个类 Main,其中包含如下所示的 main 方法: public class Main { public static void main(String[] _args) {
我有一个 .JAR 显然占用了太多内存,并抛出异常“Java 堆空间”(或类似的东西)。 所以我尝试像这样通过 CMD 运行 .JAR: C:\MyFolder>javaw -jar MyJar.ja
如果我将初始堆大小设置得相对较低(例如 -Xms128m)并将最大堆大小设置得非常高(-Xmx4g),我是否会期望对 Tomcat 性能产生负面影响?另外,将 -XX:MaxPermSize 设置为与
我知道JVM进程的-Xms标志是为了让JVM进程使用特定数量的内存来初始化它的进程。并且关于 Java 应用程序的性能,通常建议在启动应用程序时为 -Xms 和 -Xmx 设置相同的值,例如 - Xm
通常我设置-Xms512m和 -Xmx1g这样当 JVM 启动时,它会分配 512MB 并根据需要逐渐将堆增加到 1GB。但我看到这些值设置为相同的说 1g在专用服务器实例中。将两者设置为相同的值有什
我编写的 java 应用程序遇到了导致硬件性能问题的问题。问题(我相当确定)是我运行该应用程序的一些机器只有 1GB 内存。当我启动 java 应用程序时,我将堆大小设置为 -Xms 512m -Xm
我是一名优秀的程序员,十分优秀!