On 10/11/2011 2:51 PM, David Holmes wrote:
Hi Max,

On 12/10/2011 5:15 AM, Weijun Wang wrote:
I have a test consuming quite a lot of memory and seems to be only
working on server vms. I've added

String vm = System.getProperty("java.vm.name");
if (!vm.equals("Java HotSpot(TM) Server VM")) {
System.out.println("The test only runs on server VMs");
return;
}

Is there a better way to detect it?

Searching for contains("Server") would be less error-prone as the above
will not work on 64-bit. But there is a better property to use:

sun.management.compiler

which will report eg "Hotspot Client Compiler". However, these days both
properties might report Tiered rather than Server. Also for -Xint
sun.management.compiler doesn't exist.

I'll use System.getProperty("java.vm.name").contains("Server") now since that looks more intuitive for me.


That all said this seems like the wrong solution to the problem. Amount
of memory used shouldn't be that dependent on client vs. server VM

I don't know. But here is my JPRT output

  http://javaweb/~ww155710/jprt/bigcrl/report.html

The test BigCRL fails on all c1 (without*) and succeeds on all c2 (with*). It does look like it's easy to get more memory from c2.

Thanks
Max


David

Reply via email to