惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - bluesky4485

Elasticsearch及java客户端jest使用 在windows环境下基于sublime text3的node.js开发环境搭建 CentOS6.4安装及配置oracle - bluesky4485 Ant学习 - bluesky4485 Springframework3.1源码编译 win7x64下安装oraclex64版本后,plsql Developer无法登录的问题 VMWare安装redhat9后上网的的问题 Tomcat中部署后JspFactory报异常的解决方案 - bluesky4485 MyEclipse10 中增加svn插件 Oracle连接池信息的修改 OPDS1.1 VMware下Redhat9鼠标选用usb后不能使用的解决办法 m2e插件安装 Java开发Maven环境配置和介绍 javadoc生成出现错误“编码 GBK 的不可映射字符” - bluesky4485 Google常用搜索技巧 - bluesky4485 设置Google不跳转到google.com.hk CodeSmith支持中文配置 jni和C++通信中文乱码的问题 - bluesky4485
如何测试java支持的最大内存
bluesky4485 · 2012-07-18 · via 博客园 - bluesky4485

JDK在不同的操作系统中支持的最大内存不一样,可以采用如下方法来测试不同操作系统中支持的最大内存。

c:>java -XmxXXXXm(g) -version

其中XXXX为最大内存数,m(g)是内存的计量单位,在以上命令中将XXXX写为具体数字,根据情况采用m或g为单位,如果命令能正确显示出jdk的版本信息,则说明当前jdk支持XXXX的最大内存,如果不能正确显示出版本信息则表示超出了jdk支持的最大值。

例如:

C:\Users\Administrator>java -Xmx1G -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

则表示当前jdk支持1G的内存。可以通过XXXX的值的增大来慢慢测试jdk所支持的最大的内存。

一般在32位机器上,该最大值位于1.5G-2G之间,在64位机器上面应该没啥限制,经测试写9G也能正常得出版本信息。