gpt4 book ai didi

java - 即使我已经将 RAM 从 8G 升级到 16G,我仍然收到 JMeter 内存不足错误

转载 作者:行者123 更新时间:2023-12-02 08:52:11 24 4
gpt4 key购买 nike

有人可以帮我解决我在运行 JMeter 时遇到的内存不足 (OOM) 错误

我是Java和JMeter以及性能测试方面的新手。我使用了命令提示符,但仍然遇到内存不足问题。我尝试调整堆大小,但每次更改时运行都不会继续。

我当前的堆大小低于

    set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m

我添加了另一个内存:从8GB,我的内存现在是16GB
但是当我使用 1000 个线程再次运行它时,会显示以下错误:

Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread in thread Thread[Thread Group 1-130,5,main]. See the log file for details.
Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread in thread Thread[Thread Group 1-63,5,main]. See log file for details.
Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread in thread Thread[Thread Group 1-135,5,main]. See log file for details.
Uncaught Exception java.lang.OutOfMemoryError: unable to create new native thread in thread Thread[Thread Group 1-19,5,main]. See log file for details.
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate

有时我也会遇到这个错误:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate

有人可以帮助我吗?我只是一个初学者,所以如果您能用不太技术性的术语回复,我将不胜感激。

提前谢谢您。

最佳答案

您收到的错误表明底层 operating system无法创建新的 native 线程/进程。

  1. 尝试增加操作系统的限制,例如,如果您使用 Linux您可以使用 ulimit -n command 检查最大线程数
  2. 在任何情况下,您都可以通过 -Xss JVM argument 减小堆栈大小

不幸的是,在目前的情况下,您的问题没有提供足够的信息来得出全面的答案,如果上述提示无济于事,请考虑添加更多详细信息,例如:

  • 操作系统版本和架构
  • JMeter版本
  • Java 版本和存档
  • 至少 .HPROF file 的前 20 行

另请务必遵循 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure 的建议文章

关于java - 即使我已经将 RAM 从 8G 升级到 16G,我仍然收到 JMeter 内存不足错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60701312/

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