Simple Java programm runs slow on Windows 2008 Server : <p>Why is my simple Java programm runs quickly on my local computer and 
too slow on Windows 2008 Server?</p>

<p>Programm code:</p>

<pre><code>public static void main(String[] args) {
    long startTime;
    long endTime;
    long totalTime;

    startTime = System.currentTimeMillis();

    for (int a=1; a &lt; 100000; a++) {
        System.out.println("Checking");

    }

    endTime   = System.currentTimeMillis();
    totalTime = endTime - startTime;
    System.out.println("TEST1 time:"+totalTime);

    startTime = System.currentTimeMillis();

    double sum = 0; 
    for (int a=1; a &lt; 1000000; a++) {
        int input = 100;

        for(int counter=1;counter&lt;input;counter++){
            sum += Math.pow(-1,counter + 1)/((2*counter) - 1);
        }

    }

    endTime   = System.currentTimeMillis();
    totalTime = endTime - startTime;
    System.out.println("TEST2 time:"+totalTime+" pi="+sum);
}
</code></pre>

<p>Local computer output:</p>

<pre><code>Checking
Checking
Checking
Checking
TEST1 time:427
TEST2 time:7261 pi=787922.5634628027
</code></pre>

<p>Windows server output:</p>

<pre><code>Checking
Checking
Checking
Checking
Checking
Checking
TEST1 time:15688
TEST2 time:25280 pi=787922.5634628027
</code></pre>

<p>Local computer hardware and soft:
Intel Core (TM) i7-2600 CPU @ 3.40GHz
Windows 7 Professional
8G RAM</p>

<p>Server hardware and soft:</p>

<p>Intel Xeon(R) CPU E5-2603 @ 1.60GHz 
8G RAM
Windows Server 2008 Standart Version 6.0</p>

<p>Both computer and server are free from another processes.</p>

<p>May be I have to apply some parametrs to java vm? </p>
