Click here to Skip to main content
15,923,273 members
Home / Discussions / C#
   

C#

 
GeneralHttpWebRequest Troubles Pin
dhonda15-Jun-05 9:25
dhonda15-Jun-05 9:25 
QuestionBatch SqlCommand execution? Pin
Judah Gabriel Himango15-Jun-05 9:09
sponsorJudah Gabriel Himango15-Jun-05 9:09 
GeneralSockets and ArrayLists Pin
obelisk2915-Jun-05 8:33
obelisk2915-Jun-05 8:33 
GeneralRe: Sockets and ArrayLists Pin
eggie515-Jun-05 19:21
eggie515-Jun-05 19:21 
GeneralImaging Application - not enough RAM Pin
Libor Tinka15-Jun-05 8:03
Libor Tinka15-Jun-05 8:03 
GeneralRe: Imaging Application - not enough RAM Pin
DavidNohejl15-Jun-05 8:19
DavidNohejl15-Jun-05 8:19 
GeneralRe: Imaging Application - not enough RAM Pin
Judah Gabriel Himango15-Jun-05 8:30
sponsorJudah Gabriel Himango15-Jun-05 8:30 
GeneralRe: Imaging Application - not enough RAM Pin
Dave Kreskowiak15-Jun-05 8:51
mveDave Kreskowiak15-Jun-05 8:51 
dhn is partially correct. The GC is pretty lazy, but not as bad as he makes it sound. The GC Scheduler makes it's own determinations on when to run the GC process. MANY factors cause the Scheduler to either slow down the schedule or speed it up.

It doesn't run only when your running out of memory. For instance, if you suddenly dispose of a large number of objects, then the GC will kick in early to clean up and compact memory. If you only disposed a few large objects, the GC won't collect them until it's normal schedule.

Basically, looking at the Task Manager is not a good indicator of how much memory your application is actually using. What your seeing is appoxmiately how much unmanaged memory is allocated to your processes managed memory heaps, whether your using it or not. In other words, this is NOT a representation of how much unmanaged memory your application is actually using. The .NET Framework Memory Manager is also responsible for returning managed memory back to the unmanaged pool, if and when needed, or if requested by the system.

If you want to check to see how much memory check into using the Performance Monitor. For instance, according to the Task Manage, a little analog clock application that I wrote is currently occupying 13MB of Memory. The Performance Monitor says that it's more like 178KB.

Don't worry about it. The GC will collect on schedule and when it needs to. Any managed memory that needs to be released back to the system for other processes will be freed. It's just a matter of time and necessity.


Oh! BTW: Forcing the GC to collect is not a good idea unless you know exactly what your doing and why. Forcing collections will mess with the Scheduler's optimizer and can actually hurt your applications performance.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Imaging Application - not enough RAM Pin
DavidNohejl15-Jun-05 12:44
DavidNohejl15-Jun-05 12:44 
GeneralRe: Imaging Application - not enough RAM Pin
JDUK15-Jun-05 12:12
JDUK15-Jun-05 12:12 
GeneralRe: Imaging Application - not enough RAM Pin
Dave Kreskowiak15-Jun-05 18:52
mveDave Kreskowiak15-Jun-05 18:52 
GeneralRe: Imaging Application - not enough RAM Pin
Christian Graus15-Jun-05 13:48
protectorChristian Graus15-Jun-05 13:48 
GeneralRe: Imaging Application - not enough RAM Pin
Libor Tinka16-Jun-05 1:02
Libor Tinka16-Jun-05 1:02 
GeneralDetecting New Mail -- Exchange Server 2000 Pin
JMKerp295815-Jun-05 7:47
JMKerp295815-Jun-05 7:47 
GeneralNumber of pages in PrintPreviewControl Pin
Luis Alonso Ramos15-Jun-05 7:47
Luis Alonso Ramos15-Jun-05 7:47 
GeneralRe: Number of pages in PrintPreviewControl -- solved Pin
Luis Alonso Ramos15-Jun-05 8:50
Luis Alonso Ramos15-Jun-05 8:50 
GeneralOffice Interop - Populating Checkboxes Pin
tsmyrnio15-Jun-05 7:43
tsmyrnio15-Jun-05 7:43 
QuestionGDI+ drawing strings causes messed gaps between letters - how to fix? Pin
iliyang15-Jun-05 7:16
iliyang15-Jun-05 7:16 
AnswerRe: GDI+ drawing strings causes messed gaps between letters - how to fix? Pin
MoustafaS15-Jun-05 8:25
MoustafaS15-Jun-05 8:25 
GeneralRe: GDI+ drawing strings causes messed gaps between letters - how to fix? Pin
iliyang15-Jun-05 11:16
iliyang15-Jun-05 11:16 
GeneralPassing strings from C++ to C# Pin
Paul Largent15-Jun-05 6:51
Paul Largent15-Jun-05 6:51 
GeneralRe: Passing strings from C++ to C# Pin
S. Senthil Kumar15-Jun-05 6:56
S. Senthil Kumar15-Jun-05 6:56 
GeneralObtaining a reference to the TreeView item in a context menu Pin
SerialHobbyist15-Jun-05 6:28
SerialHobbyist15-Jun-05 6:28 
GeneralRe: Obtaining a reference to the TreeView item in a context menu Pin
S. Senthil Kumar15-Jun-05 7:00
S. Senthil Kumar15-Jun-05 7:00 
GeneralRe: Obtaining a reference to the TreeView item in a context menu Pin
SerialHobbyist16-Jun-05 2:48
SerialHobbyist16-Jun-05 2:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.