Click here to Skip to main content
15,893,814 members
Home / Discussions / C#
   

C#

 
QuestionEncrypting Problem Pin
kingletas27-Nov-07 17:43
kingletas27-Nov-07 17:43 
AnswerRe: Encrypting Problem Pin
Paul Conrad28-Nov-07 14:37
professionalPaul Conrad28-Nov-07 14:37 
QuestionHow to refresh child picturebox when moving (with mouse) on parent picturebox. Pin
Chintan.Desai27-Nov-07 17:39
Chintan.Desai27-Nov-07 17:39 
AnswerRe: Problem with "A low-level audio player in C#" Pin
Christian Graus27-Nov-07 19:14
protectorChristian Graus27-Nov-07 19:14 
QuestionTextbox and Integer Pin
MasterSharp27-Nov-07 15:34
MasterSharp27-Nov-07 15:34 
AnswerRe: Textbox and Integer Pin
Luc Pattyn27-Nov-07 15:50
sitebuilderLuc Pattyn27-Nov-07 15:50 
GeneralRe: Textbox and Integer Pin
MasterSharp27-Nov-07 15:54
MasterSharp27-Nov-07 15:54 
QuestionMemory Resource for a reader [modified] Pin
Vanidor27-Nov-07 14:42
Vanidor27-Nov-07 14:42 
Does anybody know how to find the memory usage for an object instance or instances? Specifically, I'm trying to figure out how much overall memory it takes to retreive data from the database and populate the object instance in two different ways. I attempted to get the memory usage of an object instance by calling System.GC.GetTotalMemory() before and after the object creation and take the difference, but it didn't work in some cases. Below is some example code on what I'm trying to do:
<br />
public int FindMemoryUsage()<br />
{<br />
    SqlDataReader reader;<br />
<br />
    int memoryBefore = System.GC.GetTotalMemory(false);<br />
    reader = /*call execute function that returns info from DB/*;<br />
    int memoryAfter = System.GC.GetTotalMemory(false);<br />
<br />
    return memoryAfter - memoryBefore; <br />
}<br />

The result of the function should return the memory usage of the reader which is dependent on the results returned from the database. However, I tested this by comparing the memory usages between retreiving just a few records and a whole lot of records from the database and the result was approximately the same. Can anyone explain to me what I'm doing wrong? Any help is greatly appreciated!!

P.S. - Why does using the 'code' tag fail to indent anything?



-- modified at 20:48 Tuesday 27th November, 2007
AnswerRe: Memory Resource for a reader Pin
TJoe29-Nov-07 2:23
TJoe29-Nov-07 2:23 
QuestionSurrounding cities functionality Pin
cliffr195427-Nov-07 13:45
professionalcliffr195427-Nov-07 13:45 
AnswerRe: Surrounding cities functionality Pin
Colin Angus Mackay27-Nov-07 14:08
Colin Angus Mackay27-Nov-07 14:08 
QuestionProgram Complete Pin
MasterSharp27-Nov-07 13:18
MasterSharp27-Nov-07 13:18 
AnswerRe: Program Complete Pin
Christian Graus27-Nov-07 19:15
protectorChristian Graus27-Nov-07 19:15 
QuestionC# Factory Pattern Pin
Jeffrey Walton27-Nov-07 12:47
Jeffrey Walton27-Nov-07 12:47 
AnswerRe: C# Factory Pattern Pin
martin_hughes27-Nov-07 13:43
martin_hughes27-Nov-07 13:43 
GeneralRe: C# Factory Pattern Pin
Jeffrey Walton27-Nov-07 14:50
Jeffrey Walton27-Nov-07 14:50 
GeneralRe: C# Factory Pattern Pin
martin_hughes28-Nov-07 3:19
martin_hughes28-Nov-07 3:19 
QuestionSimple question about ending loops Pin
falles0127-Nov-07 12:25
falles0127-Nov-07 12:25 
AnswerRe: Simple question about ending loops Pin
martin_hughes27-Nov-07 12:39
martin_hughes27-Nov-07 12:39 
GeneralRe: Simple question about ending loops Pin
falles0127-Nov-07 12:44
falles0127-Nov-07 12:44 
GeneralRe: Simple question about ending loops Pin
Colin Angus Mackay27-Nov-07 14:14
Colin Angus Mackay27-Nov-07 14:14 
GeneralRe: Simple question about ending loops Pin
martin_hughes27-Nov-07 14:52
martin_hughes27-Nov-07 14:52 
QuestionAutomatically generate Release Notes from code Pin
kozu27-Nov-07 10:31
kozu27-Nov-07 10:31 
AnswerCross post. Please ignore this thread. Pin
Pete O'Hanlon27-Nov-07 10:56
mvePete O'Hanlon27-Nov-07 10:56 
JokeRe: Cross post. Please ignore this thread. Pin
Paul Conrad27-Nov-07 12:23
professionalPaul Conrad27-Nov-07 12:23 

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.