Databases Reference
In-Depth Information
For example, an Incremental garbage collection algorithm performs its collection
work a little at a time instead of trying to work its way through the entire heap,
which results in shorter garbage collection pauses but reduces throughput.
Client Versus Server Mode
As a way to improve performance, many JVMs use Just-in-Time (JIT) compilers
to compile and optimize code as it executes. The compiler that the JVM uses
depends on the mode in which the JVM runs:
Client mode uses a JIT compiler that is optimized for applications that are
short running, need fast startup times, and require minimum memory, such
as GUI applications. Many JVMs use this mode as the default.
Server mode uses a JIT compiler that instructs the JVM to perform more
extensive run-time optimization for applications that are long running and
use substantial memory, such as database applications. Therefore, after
startup, the JVM executes slowly until it has had enough time to optimize
the code. After that, performance is considerably faster.
Performance Tip
Tune your JVM to use server mode. For database applications that run
for weeks or months at a time, slower execution during the first few
hours is a small price to pay for better performance later on.
.NET CLR
The CLR provides automatic garbage collection in much the same way as a JVM.
When your application creates a new object, the CLR allocates memory to it
from a pool of memory known as the CLR heap . The CLR also uses generational
garbage collection. The CLR has three generations: generation 0, generation 1,
and generation 2. When the garbage collector performs a collection in any of its
generations, it cleans up objects that are no longer used and reclaims the mem-
ory allocated to them. Objects that survive a collection are progressively pro-
moted to the next generation. For example, objects that survive a collection in
generation 1 are moved to generation 2 during the next collection.
Unlike a JVM, the CLR doesn't provide tuning options that allow you to
tune garbage collection. The CLR doesn't let you set a maximum limit on the
heap size. Instead, the CLR heap size depends on how much memory can be
allocated from the operating system. In addition, the CLR automatically adjusts
the sizes of the generations according to its own optimization criteria.
 
Search WWH ::




Custom Search