gpt4 book ai didi

java - JMeter:jmeter.bat和java中的heapsize可以相同吗?

转载 作者:行者123 更新时间:2023-11-30 02:50:43 25 4
gpt4 key购买 nike

我想知道对于我的 64 位 Windows 8 操作系统、16GB RAM,我可以在 jmeter.bat 和 Java 中增加多少堆大小,以避免超出 GC 开销限制。

另外,jmeter.bat和java中的heapsize可以相同吗?

最佳答案

根据 Java SE 6 HotSpot[tm] Virtual Machine Garbage Collection TuningGC 时间过多和 OutOfMemoryError 章节文章

The concurrent collector will throw an OutOfMemoryError if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown. This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small. If necessary, this feature can be disabled by adding the option -XX:-UseGCOverheadLimit to the command line.

The policy is the same as that in the parallel collector, except that time spent performing concurrent collections is not counted toward the 98% time limit. In other words, only collections performed while the application is stopped count toward excessive GC time. Such collections are typically due to a concurrent mode failure or an explicit collection request (e.g., a call to System.gc()).

它通常表明您的 Java 应用程序存在一些问题,在您的情况下 - 使用 JMeter 测试。

  1. 首先,请确保您遵循 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure 的建议充分利用 JMeter 实例的指南

  2. 尝试切换到 Concurrent Mark Sweep Garbage Collector 。为了使用它,请将下一行添加到 JMeter 启动脚本中的 ARGS:

    -XX:+UseConcMarkSweepGC
  3. 如果这没有帮助,并且您完全确定您的 JMeter 脚本和 JVM 参数都正常,您可以通过前面提到的 -XX:-UseGCOverheadLimit 关闭此行为 设置

关于java - JMeter:jmeter.bat和java中的heapsize可以相同吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38734872/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com