增加内存密集型应用程序的JVM最大堆大小 [英] Increasing the JVM maximum heap size for memory intensive applications

查看:195
本文介绍了增加内存密集型应用程序的JVM最大堆大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要运行一个使用超过2GB的Java内存密集型应用程序,但是我遇到了增加堆最大大小的问题。到目前为止,我尝试了以下方法:




  • 设置-Xmx参数,例如: -Xmx3000m。这种方法在创建JVM时失败。从我用Google搜索来看,看起来-Xmx必须小于2GB。


  • 使用 - XX:+ AggressiveHeap选项。当我尝试这种方法时,我得到一个内存不足错误,告诉堆大小为1273.4 MB,即使我的计算机有8GB内存。




我是否可以尝试增加JVM的最大堆大小?以下是计算机规格的摘要:




  • 操作系统:Windows 7(64位)

  • 处理器:英特尔酷睿i7(2.66 GHz)

  • 内存:8 GB

  • java -version:




  java版1.6.0_18
Java(TM)SE运行时环境(版本1.6.0_18 -b07)
Java HotSpot(TM)客户端VM(版本16.0-b13,混合模式,共享)



解决方案

Oracle


I need to run a Java memory intensive application that uses more than 2GB, but I am having problems to increase the heap maximum size. So far, I have tried the following approaches:

  • Setting the -Xmx parameter, e.g. -Xmx3000m. This approaches fails at the creation of the JVM. From what I've googled, it looks like that -Xmx must be less than 2GB.

  • Using the -XX:+AggressiveHeap option. When I try this approach I get an 'Not enough memory' error that tells that the heap size is 1273.4 MB, even though my computer has 8GB of memory.

Is there another approach that I can try to increase the maximum heap size of the JVM? Here's a summary of the computer specs:

  • OS: Windows 7 (64 bit)
  • Processor: Intel Core i7 (2.66 GHz)
  • Memory: 8 GB
  • java -version:

java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

解决方案

Get yourself a 64-bit JVM from Oracle.

这篇关于增加内存密集型应用程序的JVM最大堆大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆