CentOS 6和Sun / Oracle Java问题

可能重复:
Linux在VPS上的内存不足

我有一个运行CentOS 6.3 64位的OpenVZ VPS,当我尝试使用以下命令安装JRE 7 64位时:

rpm -Uvh java.rpm 

它给了我这个错误:

 Preparing... ########################################### [100%] 1:jre ########################################### [100%] Unpacking JAR files... rt.jar... Error: Could not open input file: /usr/java/jre1.7.0_09/lib/rt.pack jsse.jar... Error: Could not open input file: /usr/java/jre1.7.0_09/lib/jsse.pack charsets.jar... Error: Could not open input file: /usr/java/jre1.7.0_09/lib/charsets.pack localedata.jar... Error: Could not open input file: /usr/java/jre1.7.0_09/lib/ext/localedata.pack 

然后我尝试了这个命令:

 java -version 

它给了我这个错误:

 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. 

为什么会发生这种情况,如果我有足够的内存在VPS上运行这个(1GB)? 这可能是VPS主机节点的问题吗?

谢谢

编辑1:链接到beancounter截图http://puu.sh/1xwxB

编辑2:链接到htop截图http://puu.sh/1xwDl

根据你想要做什么,我build议停止使用OpenVZ,并使用一些真正的虚拟化解决scheme,如KVM。

尝试使用此命令运行您的Java应用程序:

 java -Xms16m