-
Bug
-
Resolution: Not an Issue
-
P3
-
6u14
-
x86
-
linux_ubuntu
casename: suite_javaws_vmargs/verify
platform:ubuntu-x64
jre-64bit
build:6u14b05
JVM cant allocate enough memory .
Case Code as below:
_____________________________________________________________
public boolean chekForHeapSize(int ms, int mx) {
System.out.println("Inside mode "+mx + " " + ms);
Runtime rt = Runtime.getRuntime();
if( rt.maxMemory() > (mx * 1024 * 1000) &&
rt.totalMemory() > (ms * 1024 * 1000) ) {
System.out.println("STATUS: "+ testName + " PASSED");
return true;
} else {
System.out.println("STATUS: "+ testName + " FAILED");
return false;
}
__________________________________________________________________
I ran this command
java client Xms60m Xmx70m memory.java
_________________________________________________________________
(memory.java:code)
public class a {
public static void main(String[] args) {
String vmname = System.getProperty("java.vm.name");
long totalM = Runtime.getRuntime().totalMemory();
long maxM = Runtime.getRuntime().maxMemory();
System.out.println("vmname="+vmname);
System.out.println("totalM="+totalM/1024+"----maxM="+maxM/1024);
}
}
__________________________________________________________________
got the output and actual memory:
Vmname=Java HotSpot(TM) 64-bit Server VM
totalM=59392------maxM=69312
Result: The actual memorys value is much smaller than the value that the case gives.
IMPT: We checked 32bits ubuntu, it looks fine. And solaris is fine too.
Reproduces every time. The value reported as totalMemory() is the memory committed for the heap, maxMemory() is the ressrved memory.
If I set -Xms60m I get 60293120 committed. That's 60M - 2.5M
platform:ubuntu-x64
jre-64bit
build:6u14b05
JVM cant allocate enough memory .
Case Code as below:
_____________________________________________________________
public boolean chekForHeapSize(int ms, int mx) {
System.out.println("Inside mode "+mx + " " + ms);
Runtime rt = Runtime.getRuntime();
if( rt.maxMemory() > (mx * 1024 * 1000) &&
rt.totalMemory() > (ms * 1024 * 1000) ) {
System.out.println("STATUS: "+ testName + " PASSED");
return true;
} else {
System.out.println("STATUS: "+ testName + " FAILED");
return false;
}
__________________________________________________________________
I ran this command
java client Xms60m Xmx70m memory.java
_________________________________________________________________
(memory.java:code)
public class a {
public static void main(String[] args) {
String vmname = System.getProperty("java.vm.name");
long totalM = Runtime.getRuntime().totalMemory();
long maxM = Runtime.getRuntime().maxMemory();
System.out.println("vmname="+vmname);
System.out.println("totalM="+totalM/1024+"----maxM="+maxM/1024);
}
}
__________________________________________________________________
got the output and actual memory:
Vmname=Java HotSpot(TM) 64-bit Server VM
totalM=59392------maxM=69312
Result: The actual memorys value is much smaller than the value that the case gives.
IMPT: We checked 32bits ubuntu, it looks fine. And solaris is fine too.
Reproduces every time. The value reported as totalMemory() is the memory committed for the heap, maxMemory() is the ressrved memory.
If I set -Xms60m I get 60293120 committed. That's 60M - 2.5M