Centos6.4  Jdk1.6

1.在终端输入Java命令报错

[root@localhost local]# java
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

2.是系统参数(overcommit_memory和overcommit_ratio)配置的问题

3.查看系统内存分配状态

[root@localhost local]# grep -i commit /proc/meminfo
CommitLimit: kB
Committed_AS: kB

  看到CommitLimit和Committed_As参数。

  CommitLimit是一个内存分配上限,CommitLimit = 物理内存 * overcommit_ratio(默认50,即50%) + swap大小
  Committed_As是已经分配的内存大小。

4.内核参数overcommit_memory

[root@localhost local]# cat /etc/sysctl.conf | grep overcommit_memory
vm.overcommit_memory=

  它是 内存分配策略

  可选值:0、1、2。
  0, 表示内核将检查是否有足够的可用内存供应用进程使用;如果有足够的可用内存,内存申请允许;否则,内存申请失败,并把错误返回给应用进程。
  1, 表示内核允许分配所有的物理内存,而不管当前的内存状态如何。
  2, 表示内核允许分配超过所有物理内存和交换空间总和的内存

5. 解决办法
  将vm.overcommit_memory 设为1即可
  有三种方式修改内核参数,但要有root权限:

1)编辑/etc/sysctl.conf ,改vm.overcommit_memory=1,然后sysctl -p 使配置文件生效

2)sysctl vm.overcommit_memory=1

3)echo 1 > /proc/sys/vm/overcommit_memory

参考:http://blog.csdn.net/whycold/article/details/21388455

http://blog.csdn.net/jollyjumper/article/details/24127009

Could not reserve enough space for object heap解决办法的更多相关文章

  1. eclipse scala Could not reserve enough space for object heap

    [学习笔记] 防盗版实名手机尾号:73203 Could not reserve enough space for object heap 解决方法:下面的缩写中:一个是memory max(Xmx) ...

  2. Android Studio: Failed to sync Gradle project 'xxx' Error:Unable to start the daemon process: could not reserve enough space for object heap.

    创建项目的时候报错: Failed to sync Gradle project 'xxx' Error:Unable to start the daemon process: could not r ...

  3. Tomcat启动报错 Could not reserve enough space for object heap

    报错信息: Error occurred during initialization of VM Could not reserve enough space for object heap Coul ...

  4. 启动tomcat报错 Could not reserve enough space for object heap的解决办法

    问题:打开eclips启动tomcat发现报出Could not reserve enough space for object heap错误. 解决办法:1.首先检查tomcat是否能正常启动.re ...

  5. Error occurred during initialization of VM Could not reserve enough space for object heap

    Error occurred during initialization of VM Could not reserve enough space for object heap Java虚拟机(JV ...

  6. fisheye Error occurred during initialization of VM Could not reserve enough space for object heap 问题解决!

    参考文章:https://answers.atlassian.com/questions/9397/not-enough-heap-space-to-run-fisheye fisheye下载好了之后 ...

  7. 构建工具----gradle---可能遇到的问题----Could not reserve enough space for object heap

    Could not reserve enough space for object heap 意思是 jvm的设置内存不足以运行gradle命令了. 分为两种情况,解决的方法也不同. .10/user ...

  8. JVM启动报错: Could not reserve enough space for object heap error

    首先了解一下参数的含义: 参数 含义 -Xms2G -Xmx2G 代表jvm可用的heap内存最小和最大 -XX:PermSize -XX:MaxPermSize 代表jvm的metadata内存的大 ...

  9. Android Studio Gradle Could not reserve enough space for object heap

    Studio 创建第一个工程报错 Error:Unable to start the daemon process.This problem might be caused by incorrect ...

随机推荐

  1. SSH后台管理系统,实现查询+分页

    一个搜索框,然后会获取大量信息,将信息进行分页,每一页显示固定条数. mysql中使用“like”和“%%”进行模糊匹配,用“limit”进行分页. 1.首先创建一个页面信息的实体类,代码如下: im ...

  2. Linux(Centos6.5)下安装svn服务器,并通过http访问

    linux安装svn其实很容易,个人觉得难就难在配置上,反复配置,琢磨,查找相关资料,总算是成功了.. 安装: 安装svn,一般情况下,选择yum方式安装还是比较简单的. ? 1 2 [root@mo ...

  3. MVC架构模式概述

    MVC MVC概述: Model–view–controller (MVC) is a software architectural pattern for implementing user int ...

  4. SharePoint服务器端对象模型 之 访问网站和列表数据(Part 3)

    (三)视图 与传统意义上的数据视图类似,SharePoint中的列表视图指定了列表中数据的筛选条件.排序条件.分组条件.显示栏/字段.显示条目数.显示样式等内容.在SharePoint中,使用SPVi ...

  5. mysql编译参数详解(./configure)

    1.--prefix=PREFIX:指定程序安装路径: 2.--enable-assembler:使用汇编模式:(文档说明:compiling in x86 (and sparc) versions  ...

  6. 密钥管理服务KMS

    密钥管理服务 KMS - 腾讯云 https://cloud.tencent.com/product/kms

  7. mock数据(模拟后台数据)

    mock数据(模拟后台数据) - Emily恩 - 博客园 https://www.cnblogs.com/enboke/p/vue.html Mock.js http://mockjs.com/ 前 ...

  8. MySQL中Index Condition Pushdown(ICP)优化

    在MySQL 5.6开始支持的一种根据索引进行查询的优化方式.之前的MySQL数据库版本不支持ICP,当进行索引查询是,首先根据索引来查找记录,然后在根据WHERE条件来过滤记录.在支持ICP后,My ...

  9. Js前台页面搜索

    $("#filter").on("keyup",function(){$(".aimed_list").hide().filter(&quo ...

  10. Spring Boot在aop中获取request对象

    doBefore(){ ServetRequestAttrbtes attributes = (ServetRequestAttrbtes)RequestContextHolder.getHttpat ...