Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Memory allocation : 4x slower on Solaris vs Windows

843811May 3 2003 — edited May 6 2003
Hello,

While tracking down an application performance problem, we break it down to memory allocation.
A simple memory allocation test shows up that the process is 4 times slower on Solaris machines vs PC.

The program is given below. It was tested against Java 2 SDK, Standard edition (1.3.0_02) on a regular P4 1.6 Ghz (NT 4 SP6) with 512 Mb RAM and a Sun E10K (8 CPU - 12 Gb RAM), with solaris 2.6 (we were not the sole users of this machine - load average was 5-10% at test time)

The average execution time is around 320 ms on the PC and 1145 ms on Solaris.

Using the right -Xms and -Xmx options, we reduced the execution time to 110ms on the PC and 250ms on Solaris

Using Java 1.3.1 improves the perf for around 10% on both platforms. (Java 1.4 is not an option for our customer)

The best results we had on solaris are around 60 ms using a Sun E15K (16 CPU, 16Gb RAM and nobody else on the machine :-)

Is this slow memory allocation time on Solaris a know problem of JVMs on this OS ? How can we do things better ?

Hope someone can help

Sebastien Stormacq
Chief Architect
Aubay Luxembourg

******************************************

public class TestPerf {
/****/
private static final int INSTANCE_NUMBER = 3000;

/****/
public static void main(String[] args) {
long start = System.currentTimeMillis();
Object[] ar = new Object[INSTANCE_NUMBER];
for (int i=0; i<INSTANCE_NUMBER; i++) {
Object[] o = new Object[1024];
ar[i] = o;
}
System.out.println("delay : " +
(System.currentTimeMillis()-start));
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 3 2003
Added on May 3 2003
2 comments
202 views