Click here to Skip to main content
15,900,724 members
Home / Discussions / C#
   

C#

 
QuestionRead Photo Taken Date Pin
S K Y8-Apr-09 15:02
S K Y8-Apr-09 15:02 
AnswerRe: Read Photo Taken Date Pin
Luc Pattyn8-Apr-09 15:14
sitebuilderLuc Pattyn8-Apr-09 15:14 
General[Message Deleted] Pin
S K Y8-Apr-09 15:41
S K Y8-Apr-09 15:41 
GeneralRe: Read Photo Taken Date Pin
Luc Pattyn8-Apr-09 16:04
sitebuilderLuc Pattyn8-Apr-09 16:04 
QuestionSystem.Data.OracleClient - "System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." [modified] Pin
devvvy8-Apr-09 14:58
devvvy8-Apr-09 14:58 
QuestionLarge memory usage. Pin
Jacob Dixon8-Apr-09 14:55
Jacob Dixon8-Apr-09 14:55 
AnswerRe: Large memory usage. Pin
Jacob Dixon8-Apr-09 15:00
Jacob Dixon8-Apr-09 15:00 
AnswerRe: Large memory usage. Pin
Luc Pattyn8-Apr-09 15:04
sitebuilderLuc Pattyn8-Apr-09 15:04 
Hi,

Task Manager is not providing the right information. It shows how much memory an app is currently entitled to use, not how much is actually used. When a .NET app needs memory, it either looks for free memory inside the process, or asks Windows for more. When objects die, their memory is garbage collected but not necessarily returned to Windows.

One experiment you could do is this: minimize your main form, then watch Task Manager. The number will be lower now. If that reduced number stays somewhat constant over time (each time minimizing), then as a first approximation your app isn't loosing/wasting memory. If that number keeps growing, your app probably has some memory leaks.

I often include a permanent memory observer in the app itself: have a timer regularly update a label and have it show the value of Environment.WorkingSet (divide by 1024*1024 to get megabytes). That is more comfortable and more reliable than the TM numbers.

PS: large is a relative notion. If your system has ample memory and Windows is willing to give 500MB of memory to your app, then the app will use that to its advantage, i.e. the need to garbage collect will be reduced.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


GeneralRe: Large memory usage. Pin
Jacob Dixon8-Apr-09 15:10
Jacob Dixon8-Apr-09 15:10 
GeneralRe: Large memory usage. Pin
Luc Pattyn8-Apr-09 15:15
sitebuilderLuc Pattyn8-Apr-09 15:15 
GeneralRe: Large memory usage. Pin
Jacob Dixon8-Apr-09 16:52
Jacob Dixon8-Apr-09 16:52 
GeneralRe: Large memory usage. Pin
Luc Pattyn8-Apr-09 17:17
sitebuilderLuc Pattyn8-Apr-09 17:17 
GeneralRe: Large memory usage. Pin
harold aptroot8-Apr-09 15:35
harold aptroot8-Apr-09 15:35 
GeneralRe: Large memory usage. Pin
Luc Pattyn8-Apr-09 15:58
sitebuilderLuc Pattyn8-Apr-09 15:58 
GeneralRe: Large memory usage. Pin
harold aptroot8-Apr-09 16:37
harold aptroot8-Apr-09 16:37 
GeneralRe: Large memory usage. Pin
Luc Pattyn8-Apr-09 17:05
sitebuilderLuc Pattyn8-Apr-09 17:05 
GeneralRe: Large memory usage. Pin
Dave Kreskowiak8-Apr-09 17:47
mveDave Kreskowiak8-Apr-09 17:47 
GeneralRe: Large memory usage. Pin
harold aptroot9-Apr-09 4:59
harold aptroot9-Apr-09 4:59 
GeneralRe: Large memory usage. Pin
Dave Kreskowiak9-Apr-09 13:16
mveDave Kreskowiak9-Apr-09 13:16 
GeneralRe: Large memory usage. Pin
harold aptroot9-Apr-09 13:38
harold aptroot9-Apr-09 13:38 
GeneralRe: Large memory usage. Pin
S. Senthil Kumar8-Apr-09 23:03
S. Senthil Kumar8-Apr-09 23:03 
GeneralRe: Large memory usage. Pin
harold aptroot9-Apr-09 5:00
harold aptroot9-Apr-09 5:00 
GeneralRe: Large memory usage. Pin
Jacob Dixon9-Apr-09 5:16
Jacob Dixon9-Apr-09 5:16 
GeneralRe: Large memory usage. Pin
Luc 6480119-Apr-09 5:39
Luc 6480119-Apr-09 5:39 
AnswerRe: Large memory usage. Pin
Anubhava Dimri8-Apr-09 19:57
Anubhava Dimri8-Apr-09 19:57 

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.