473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Question about Garbage Collection with Framework 1.0 and 2.0

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,
Dec 13 '06 #1
3 1325
"Buddy Home" <Bu*******@Home.comwrote in message
news:45***********************@news.zen.co.uk...
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.

Dec 14 '06 #2
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,

"Willy Denoyette [MVP]" wrote:
"Buddy Home" <Bu*******@Home.comwrote in message
news:45***********************@news.zen.co.uk...
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.

Dec 14 '06 #3
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?
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:66**********************************@microsof t.com...
Sounds to me like you might need a Blocking Queue, if you are dequeing
your
"Stuff" in a big loop. One of the biggest causes of runup in memory and
pegging the CPU.
Peer

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Buddy" wrote:
>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,

"Peter Bromberg [C# MVP]" wrote:
It would seem to me that your first priority here would be to find out
why
you have such a memory run-up in your app, rather than attempting to
band-aid
it with different GC Workstation/ Server models.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Buddy Home" wrote:

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,

Dec 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob | last post by:
Are there any known applications out there used to test the performance of the .NET garbage collector over a long period of time? Basically I need an application that creates objects, uses them, and...
2
by: Barry Anderberg | last post by:
I've been doing some reading about Finalize and garbage collection. I've learned that finalizing should be avoided because objects that have a finalize method require 2 (possibly more) itterations...
11
by: Johannes Bauer | last post by:
Hi group, inspired by the other inline assembly thread a question popped up in my mind... Victor Bazarov mentioned in his response that the asm() clause was covered by the C++ standard,...
14
by: Arvind | last post by:
hello ppl, i am trying to implement a garbage collector for c++ using the generational algorithm applying mark-sweep to each generation. i am unable to get any details about the algorithm. is it...
2
by: Howard Weiss | last post by:
I am writing a Managed C++ application. In my application, I create a modeless sub-form using New. I retain a pointer to this sub-form in my application. If the user closes this form, my...
6
by: Andy | last post by:
Along with many others I've noticed the large amount of memory that can be taken up by the aspnet_wp.exe. I've found that I can better control and limit this memory consumption by including a...
5
by: Michael Moreno | last post by:
Hello, In a class I have this code: public object Obj; If Obj is a COM object I would like to call in the Dispose() method the following code: ...
4
by: Diffident | last post by:
Hello All, I have a question which is pertinent to Page's lifecycle. I declared a protected static object (global variable within that class) whose value is set only once when the page is...
7
by: heddy | last post by:
I have an array of objects. When I use Array.Resize<T>(ref Object,int Newsize); and the newsize is smaller then what the array was previously, are the resources allocated to the objects that are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.