Question about Garbage Collection with Framework 1.0 and 2.0

B

Buddy Home

Hello,

We have a system that is written in Framework 1.0 and runs under Framework
1.0. It uses the CLR Workstation to load the application. Framework 1.0
would require us to write unmanaged code to launch the application under CLR
Server.

My understanding is that if the application is launched by CLR Workstation
then we have only one thread for the GC throughout the application on a
server that has multiple CPU's, whereas if the application was running
within the CLR Server then we would have a GC thread per CPU. This would
increase the performance of the application.

I understand that in Framework 1.1 SP1 and greater you can add a config
setting to use the ServerGC but due to us still runing framework 1.0 this
option is not available.

Basically this whats happening.
1. The garbage collection does collect the memory but sometimes allows the
memory to grow and suddenly we might get an OutOfMemoryException because
it's left it late to collect the memory.
2. When the memory of the process exceeds 800MB and more we notice the
performance of the whole application degrades.

Please note we are planning to upgrade to Framework 2.0 but in the mean time
just wanted to know if my understanding was correct.

Thanks,
 
W

Willy Denoyette [MVP]

Buddy Home said:
Hello,

We have a system that is written in Framework 1.0 and runs under Framework 1.0. It uses
the CLR Workstation to load the application. Framework 1.0 would require us to write
unmanaged code to launch the application under CLR Server.

My understanding is that if the application is launched by CLR Workstation then we have
only one thread for the GC throughout the application on a server that has multiple CPU's,
whereas if the application was running within the CLR Server then we would have a GC
thread per CPU. This would increase the performance of the application.

I understand that in Framework 1.1 SP1 and greater you can add a config setting to use the
ServerGC but due to us still runing framework 1.0 this option is not available.

Basically this whats happening.
1. The garbage collection does collect the memory but sometimes allows the memory to grow
and suddenly we might get an OutOfMemoryException because it's left it late to collect the
memory.
2. When the memory of the process exceeds 800MB and more we notice the performance of the
whole application degrades.

Please note we are planning to upgrade to Framework 2.0 but in the mean time just wanted
to know if my understanding was correct.

Thanks,


In top of what Peter said, it won't help you to switch to the server GC, nor can you expect
a better performance from the server GC in V1.0 of the framework. My guess is that you have
a memory allocation issue because of memory fragmentation, notably LOH fragmentation.
- What kind of application is this (server style or windows)?
- are you allocating large objects?
- and what stops you to run under V1.1 SP1?
Note that the latter is something you better do instead of a move from V1.0 to v2.0.

Willy.
 
G

Guest

I forgot to say the following things.
1. The application is a server process.
2. The memory builds up when we receive a load of market data which we store
in the .net Queue object. We have a background thread that deques the message
and processes it.

Thanks,
 
B

Buddy Home

Thanks for the reply,

Thread1 will enqueue a message into say Queue1.
Thread2 will dequeue the message from Queue1.
Both threads will lock the queue while it enqueue's or dequeue's.

I'm a bit confused with the blocking queue that you have mentioned. How will
that help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top