Click here to Skip to main content
15,922,427 members
Home / Discussions / C#
   

C#

 
GeneralRe: Find Selected row in Datagrid Pin
Robert Rohde14-Mar-05 23:10
Robert Rohde14-Mar-05 23:10 
GeneralRe: Find Selected row in Datagrid Pin
joy_priyank14-Mar-05 23:54
joy_priyank14-Mar-05 23:54 
GeneralRe: Find Selected row in Datagrid Pin
Robert Rohde15-Mar-05 6:14
Robert Rohde15-Mar-05 6:14 
GeneralRe: Find Selected row in Datagrid Pin
DriesDeRudder16-Mar-05 4:10
DriesDeRudder16-Mar-05 4:10 
GeneralC# binary image to web PHP Pin
poomunch314-Mar-05 14:28
poomunch314-Mar-05 14:28 
GeneralStreams and Files Pin
felopater14-Mar-05 14:19
felopater14-Mar-05 14:19 
GeneralBeginner's Class -> Memory Questions Pin
GhostsOfOrion14-Mar-05 13:10
GhostsOfOrion14-Mar-05 13:10 
GeneralRe: Beginner's Class -> Memory Questions Pin
S. Senthil Kumar14-Mar-05 17:59
S. Senthil Kumar14-Mar-05 17:59 
You need to differentiate between code and data. Code is loaded only once (per appdomain, if the assembly is not domain neutral) when the assembly containing the type is loaded into memory. That includes code for methods. Along with code, static data is also loaded only once. It makes sense because code is not going to change every time you create an object.

When you instantiate an object (assuming it is a reference type), memory is allocated for all member variables. If the member is a value type, then memory allocated is equal to the size of the type. If the member is a reference type, unless you've instantiated it in the constructor, memory is allocated only to hold a reference, ie, 4 bytes in 32 bit machines.

What you said about variables in scope of methods holds true only for value types (structs, enums..). For reference types, memory remains allocated till all references to it are lost.

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Beginner's Class -> Memory Questions Pin
GhostsOfOrion14-Mar-05 18:31
GhostsOfOrion14-Mar-05 18:31 
GeneralOpening and reading access Database using csharp Pin
gijoebijoe14-Mar-05 8:39
gijoebijoe14-Mar-05 8:39 
GeneralRe: Opening and reading access Database using csharp Pin
Judah Gabriel Himango14-Mar-05 8:52
sponsorJudah Gabriel Himango14-Mar-05 8:52 
GeneralRe: Opening and reading access Database using csharp Pin
Ravindra Sadaphule14-Mar-05 12:48
Ravindra Sadaphule14-Mar-05 12:48 
GeneralBug in CSC.Exe Pin
raysot77714-Mar-05 8:38
raysot77714-Mar-05 8:38 
GeneralRe: Bug in CSC.Exe Pin
Ravindra Sadaphule14-Mar-05 12:57
Ravindra Sadaphule14-Mar-05 12:57 
GeneralRe: Bug in CSC.Exe Pin
Anonymous14-Mar-05 15:19
Anonymous14-Mar-05 15:19 
Generallistview with transparent background Pin
grandad8014-Mar-05 8:21
sussgrandad8014-Mar-05 8:21 
QuestionConfiguration Files? Pin
spacebass500014-Mar-05 7:39
spacebass500014-Mar-05 7:39 
AnswerRe: Configuration Files? Pin
Anonymous14-Mar-05 8:58
Anonymous14-Mar-05 8:58 
GeneralThread Pin
Blue_Skye14-Mar-05 6:56
Blue_Skye14-Mar-05 6:56 
GeneralRe: Thread Pin
Judah Gabriel Himango14-Mar-05 7:26
sponsorJudah Gabriel Himango14-Mar-05 7:26 
GeneralC# pixel color grouping Pin
Rene Xavier14-Mar-05 6:56
Rene Xavier14-Mar-05 6:56 
GeneralRe: C# pixel color grouping Pin
Robert Rohde14-Mar-05 18:42
Robert Rohde14-Mar-05 18:42 
GeneralRe: C# pixel color grouping Pin
Rene Xavier14-Mar-05 19:48
Rene Xavier14-Mar-05 19:48 
GeneralRe: C# pixel color grouping Pin
Robert Rohde15-Mar-05 6:24
Robert Rohde15-Mar-05 6:24 
GeneralRe: C# pixel color grouping Pin
Rene Xavier15-Mar-05 14:43
Rene Xavier15-Mar-05 14:43 

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.