detect server VM in reg test?

Weijun Wang at
Tue Oct 11 22:21:37 UTC 2011

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("");
>> 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:
> which will report eg "Hotspot Client Compiler". However, these days both
> properties might report Tiered rather than Server. Also for -Xint
> doesn't exist.

I'll use System.getProperty("").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


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.


> David

More information about the core-libs-dev mailing list