linux虚拟机内存不够,为什么我在Linux虚拟机上遇到内存不足错误,但它在正常的Windows 10上工作?...

我的命令行java程序在分配有1GB RAM的双核CPU的Windows 10工作站上运行时工作。为什么我在Linux虚拟机上遇到内存不足错误,但它在正常的Windows 10上工作?

但是,当我在具有4个vCPU且具有12GB RAM的Ubuntu虚拟机上运行它时遇到内存不足错误。

两者都使用-Xms和-Xmx运行相应的值。

这是一个奇怪的错误。

更新: 1)我不能分享代码,不要声音傲慢或任何东西,但我认为代码没有问题。

2)错误如下:

#

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

# Native memory allocation (mmap) failed to map 12288 bytes for committing reserved memory.

# Possible reasons:

# The system is out of physical RAM or swap space

# In 32 bit mode, the process size limit was hit

# Possible solutions:

# Reduce memory load on the system

# Increase physical memory or swap space

# Check if swap backing store is full

# Use 64 bit Java on a 64 bit OS

# Decrease Java heap size (-Xmx/-Xms)

# Decrease number of Java threads

# Decrease Java thread stack sizes (-Xss)

# Set larger code cache with -XX:ReservedCodeCacheSize=

# This output file may be truncated or incomplete.

#

# Out of Memory Error (os_linux.cpp:2627), pid=22403, tid=0x00007f52f9f2c700

#

# JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)

# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode linux-amd64 compressed oops)

# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

#

顺便说一句,我的虚拟机的最大内存12GB的是,我用-Xms12160m -Xmx12160m。 至于我的工作站,我的最大内存为2GB,但我用-Xms1024m -Xmx1024m

2016-07-26

Isaac

+5

很难帮助你而不看到一些代码。 –

+0

你能否提供一些额外的信息?像你的程序一样?或发布错误 –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值