Re: Framework 2.0 array redim unsatisfactory performance
- From: "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@xxxxxxx>
- Date: Wed, 10 Aug 2005 21:35:45 -0500
Tom,
| Process.GetCurrentProcess().WorkingSet64
WorkingSet64 is the Working Set or total amount of physical memory in use,
this is by no means the amount of memory the GC has allocated. In other
words it includes objects that have not yet been garbage collected, plus it
includes the space for objects that were previously allocated but have
already been collected.
As I stated, the GC over allocates physical memory as needed & will only
return it when the OS requests it as another app is asking for more
memory... In other words the Working Set includes both allocated memory &
free memory. You need to use the .NET performance counters or CLR Profiler
to see how much memory is currently allocated.
| What I am looking for is dynamic data structure which has the least memory
| overhead.
That would be List(Of T) with the "capacity" constructor set to the expected
number of elements. For example if you know there are going to be 50 to 75
elements in the list, but no more then 100. I would pass 50 or 75 to the
constructor. With 50, there would be at most a single reallocation.
If your not sure what the limit is going to be, but once the list is filled
its "constant", the I would recommend using List(Of T).TrimExcess when I
finished filling the list.
http://msdn2.microsoft.com/library/ms132207(en-us,vs.80).aspx
Hope this helps
Jay
"Tom Jastrzebski" <tom@xxxxxxx> wrote in message
news:qNxKe.68$UA1.27@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Jay,
|
| I just noticed something I thought was interesting and decided to write
| about it, thinking that someone migrating from VB 6.0 may experience this
| issue, regardless of what the root cause is and whether these environments
| should be compared or not.
|
| As I said, the only reason why I tried "array redim" was because I was
| hoping to be nicely surprised - and I was not.
|
| What I am looking for is dynamic data structure which has the least memory
| overhead.
| It seems like at some point I will have to develop my own. But that is OK,
| it by no means diminish the value of .Net Framework.
|
| To check process memory utilization I use:
| Process.GetCurrentProcess().WorkingSet64
|
| Peace,
| Tomasz
|
|
.
- Follow-Ups:
- Re: Framework 2.0 array redim unsatisfactory performance
- From: Tom Jastrzebski
- Re: Framework 2.0 array redim unsatisfactory performance
- References:
- Framework 2.0 array redim unsatisfactory performance
- From: Tom Jastrzebski
- Re: Framework 2.0 array redim unsatisfactory performance
- From: Jay B. Harlow [MVP - Outlook]
- Re: Framework 2.0 array redim unsatisfactory performance
- From: Tom Jastrzebski
- Re: Framework 2.0 array redim unsatisfactory performance
- From: Jay B. Harlow [MVP - Outlook]
- Re: Framework 2.0 array redim unsatisfactory performance
- From: Tom Jastrzebski
- Re: Framework 2.0 array redim unsatisfactory performance
- From: Jay B. Harlow [MVP - Outlook]
- Re: Framework 2.0 array redim unsatisfactory performance
- From: Tom Jastrzebski
- Framework 2.0 array redim unsatisfactory performance
- Prev by Date: Re: open .NET shell programmatically
- Next by Date: Catching Click Events on a Custom Control
- Previous by thread: Re: Framework 2.0 array redim unsatisfactory performance
- Next by thread: Re: Framework 2.0 array redim unsatisfactory performance
- Index(es):
Relevant Pages
|
Loading