How should I tune the Container JVM for maximum performance?

There are a couple of VM flags that need to be set for reasonable performance.

The main issue is that VBJ-based programs require a good deal of memory to run well. Unfortunately, the default VM configuration does not provide a good deal of memory. Thus, the VM spends a lot of its time garbage collecting (> 80% in some cases). By increasing the default memory size and by decreasing the amount of memory VBJ uses, things run significantly faster.

For anyone doing performance testing, we would recommend the following flags:

Servers: -Xms32m -Xmx32m -Dvbroker.orb.streamChunkSize=1024
Clients: -Xms16m -Xmx16m -Dvbroker.orb.streamChunkSize=1024

These flags go between the driver (for example, "java" or "vbj") and the name of the Java main class. These flags have the following meanings:

-Xms32m                              Sets the default heap size to 32 Mb.
-Xmx32m                              Sets the maximum heap size to 32 Mb.
-Dvbroker.orb.streamChunkSize=1024   Sets the default buffer size to 1024 bytes.
Increasing the heap size is useful because your program can run for longer periods between GCs. It is much more efficient for the GC to make big runs infrequently than to make small runs frequently, due to the significant overhead of doing GC.

Enabling verbose GC (using -vertbosegc) is useful to see what is going on. It will give you an indication of how much time your program is doing GC. For example, if you don't specify the heap size and go with the default setting, GC'ing is done every 100-120 ms. This is ridiculous since it takes about 80-90 ms for the GC to start and stop (and hence your program runs 3-4 times as slow). You would like to see the GC running at most once every 5 seconds, which was achieved on a particular machine with the above heap size settings, on Solaris using JDK 1.2. Your mileage will vary on different OSes and VMs.

Changing the default chunk size for streams (for example, buffers) is useful as a performance tweak at the ORB level where buffers won't burn through the heap as quickly.