编译openjdk,遇到如下文图,怎么解决 5C

ubuntu:~/jdk8u$ make all CONF=linux-x86_64-normal-server-slowdebug
Building 'linux-x86_64-normal-server-slowdebug' (matching CONF=linux-x86_64-normal-server-slowdebug)
Building OpenJDK for target 'all' in configuration 'linux-x86_64-normal-server-slowdebug'

Starting langtools

Finished langtools (build time 00:00:00)

Starting hotspot

Finished hotspot (build time 00:00:00)

Starting corba

Finished corba (build time 00:00:00)

Starting jaxp

Finished jaxp (build time 00:00:00)

Starting jaxws

Finished jaxws (build time 00:00:00)

Finished jaxws (build time 00:00:00)

Starting jdk

Compiling 9478 files for BUILD_JDK
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000dd340000, 416022528, 0) failed; error='Cannot allocate memory' (errno=12)
#

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (malloc) failed to allocate 416022528 bytes for committing reserved memory.

An error report file with more information is saved as:

/home/yangfan/jdk8u/jdk/make/hs_err_pid21256.log

CompileJavaClasses.gmk:326: recipe for target '/home/yangfan/jdk8u/build/linux-x86_64-normal-server-slowdebug/jdk/classes/_the.BUILD_JDK_batch' failed
make[2]: *** [/home/yangfan/jdk8u/build/linux-x86_64-normal-server-slowdebug/jdk/classes/_the.BUILD_JDK_batch] Error 1
BuildJdk.gmk:64: recipe for target 'classes-only' failed
make[1]: *** [classes-only] Error 2
/home/yangfan/jdk8u//make/Main.gmk:116: recipe for target 'jdk-only' failed
make: *** [jdk-only] Error 2

1个回答

你是要交叉编译吗?看起来是你的内存不够了,但是你这目标版本还是普通服务版,还不是alphine版本或者slim版本。
如果你用虚拟机,给虚拟机增加内存。
如果你是实体机,最快的方式是增加你机子的内存。
如果不想花钱升级内存的话,用虚拟内存应该也是可以的,虚拟内存的配置方法,给/swap目录重新挂载一个更大的硬盘空间。

zjgd123
zjgd123 我也遇到了,确实是这个问题
5 个月之前 回复
zjgd123
zjgd123 我也遇到了,确实是这个问题
5 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐