gpt4 book ai didi

java - 这是内存不足造成的吗?

转载 作者:行者123 更新时间:2023-12-04 13:09:55 30 4
gpt4 key购买 nike

这个问题是我用chipyard编译Boom的时候出现的。这是因为内存不足吗?我在一个1核2G的云服务器上运行。

/bin/bash: line 1: 9986 Killed java -Xmx8G -Xss8M-XX:MaxPermSize=256M -jar /home/cuiyujie/workspace/Boom/chipyard/generators/rocket-chip/sbt-launch.jar-Dsbt.sourcemode=true -Dsbt.workspace=/home/cuiyujie/workspace/Boom/chipyard/tools ";project utilities; runMain utilities.GenerateSimFiles -td/home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig-sim verilator"/home/cuiyujie/workspace/Boom/chipyard/common.mk:86: recipe for target'/home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/sim_files.f'failedmake: *** [/home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/sim_files.f]Error 137

当我把内存调到4G时,出现了这个。

Done elaborating. OpenJDK 64-Bit Server VM warning: INFO:os::commit_memory(0x00000006dc3b7000, 97148928, 0) failed;error='Cannot allocate memory' (errno=12)

There is insufficient memory for the Java Runtime Environment to continue.Native memory allocation (mmap) failed to map 97148928 bytes for committing reserved memory.An error report file with more information is saved as:/home/cuiyujie/workspace/Boom/chipyard/hs_err_pid2876.log /home/cuiyujie/workspace/Boom/chipyard/common.mk:97: recipe for target'generator_temp' failed make: *** [generator_temp] Error 1

是应该调整到8G内存,还是通过什么命令来增加进程可以使用的内存大小?

当我把内存调到16G时,就出现了这个。

/bin/bash: line 1: 2642 Killed java -Xmx8G -Xss8M-XX:MaxPermSize=256M -jar /home/cuiyujie/workspace/Boom/chipyard/generators/rocket-chip/sbt-launch.jar-Dsbt.sourcemode=true -Dsbt.workspace=/home/cuiyujie/workspace/Boom/chipyard/tools ";project tapeout; runMain barstools.tapeout.transforms.GenerateTopAndHarness -o/home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.top.v-tho /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.harness.v-i /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.fir--syn-top ChipTop --harness-top TestHarness -faf /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.anno.json-tsaof /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.top.anno.json-tdf /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/firrtl_black_box_resource_files.top.f-tsf /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.top.fir-thaof /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.harness.anno.json-hdf /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/firrtl_black_box_resource_files.harness.f-thf /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.harness.fir--infer-rw --repl-seq-mem -c:TestHarness:-o:/home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.top.mems.conf-thconf /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig/chipyard.TestHarness.LargeBoomConfig.harness.mems.conf-td /home/cuiyujie/workspace/Boom/chipyard/sims/verilator/generated-src/chipyard.TestHarness.LargeBoomConfig-ll error" /home/cuiyujie/workspace/Boom/chipyard/common.mk:123: recipe for target 'firrtl_temp' failed make: *** [firrtl_temp] Error137

最佳答案

简短回答:是


错误 137 当您的主机内存不足时抛出。

"I am running on a 1 core 2G cloud server"

当您尝试将 8GB 分配给 JVM 时,OOM-Killer“不-不,f...不行”,并开始发送 SIGKILL此 Killer 是一个主动进程,当内存级别过低时,它会通过终止资源滥用进程来拯救系统。

在这种情况下,滥用进程(确实非常滥用)是您的 java 程序,它试图分配超过 (*) 4 次主机中的最大可用内存

Exit Codes With Special Meanings

enter image description here

                 [error code 137 --> kill -9] (SIGKILL)

你应该:

  • 最多分配 ~1.2GB - 1.5GB 给您的进程。 (并保持你的手指交叉)

  • 如果您的进程确实需要那么多内存,请将您的主机换成更强大/更大的东西。

  • 检查该进程是否真的需要 8GB


另请注意,给定的参数容易出错:Xmx8G -Xss8M 表示堆的最大值为 8GB,最小值为 8M。这应该更接近,因为 Xmx8G - Xms4G

*因为空闲内存也不会是 2GB,而是介于 1.6-1.8GB 之间

关于java - 这是内存不足造成的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66539759/

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