Click here to Skip to main content
15,885,985 members
Home / Discussions / C#
   

C#

 
GeneralRe: Few question about static class c# Pin
Marco Bertschi25-Mar-13 10:16
protectorMarco Bertschi25-Mar-13 10:16 
GeneralRe: Few question about static class c# Pin
Tridip Bhattacharjee25-Mar-13 21:31
professionalTridip Bhattacharjee25-Mar-13 21:31 
GeneralRe: Few question about static class c# Pin
Marco Bertschi25-Mar-13 22:20
protectorMarco Bertschi25-Mar-13 22:20 
AnswerRe: Few question about static class c# Pin
DaveyM6925-Mar-13 9:45
professionalDaveyM6925-Mar-13 9:45 
AnswerRe: Few question about static class c# Pin
V.25-Mar-13 23:04
professionalV.25-Mar-13 23:04 
Questionhow memory is allocated for class, class data member and member function & interface and class instance ? Pin
Tridip Bhattacharjee25-Mar-13 4:59
professionalTridip Bhattacharjee25-Mar-13 4:59 
AnswerRe: how memory is allocated for class, class data member and member function & interface and class instance ? Pin
Paulo Zemek25-Mar-13 5:28
mvaPaulo Zemek25-Mar-13 5:28 
GeneralRe: how memory is allocated for class, class data member and member function & interface and class instance ? Pin
Tridip Bhattacharjee25-Mar-13 9:26
professionalTridip Bhattacharjee25-Mar-13 9:26 
thanks for your answer & time. few things got clear after reading your answer but still few area is not clear and those are.

1) Any code that should be loaded (like a method) will eventually use memory. I say eventually because it may not have been jitted yet, but when it is, it will use memory. But that will happen only once. It is not important if you have 1 instance or 1000 instances. The method is only once on memory.

we know that JIT compiler generate machine code at run time. so when i will create a instance of employee class then how much memory will be allocated?

when we call method like instance.methodname() then memory will be allocated for method? but how much memory will allocated i just can not visualize.

u said - The method is only once on memory. how long method will be on memory ? until we dispose that instance ?

another thing u did not say like if local variable declare in method where they will be stored....in heap or stack?

2) u said :- Any reference (the "pointer") is 4 bytes on 32-computers and 8 bytes on 64-bit computers.
can u plzz explain in more detail the point 2 with sample code. which references u r talking about here.
a class may have many data member like string,double,float & datetime etc.

3) u said :- Also, virtual methods (and interfaces are included) occupy memory for their vtable... again, it is once for the class, it is not important if you have 1 instance or 1 million.

i just like to know how memory is occupied for interface ? because interface is abstract not concrete. can u please come with sample code just to show me when & how memory is allocated for interface

4) u said :- value types and the reference themselves are kept on the "actual" location (stack or heap) while the created reference type object is always on the heap, at another location.

the above point 4 not at all clear. we know when we create instance then memory is allocated for that instance is on heap not stack. please discuss the point 4 in more details with example.

i apologize that many area still not clear and here i discuss with point wise. so when u give answer then please give it point wise and also with example for better visualization.

if possible give me some links of site from where class, instance and memory allocation doubts can be more clear. thanks
tbhattacharjee

GeneralRe: how memory is allocated for class, class data member and member function & interface and class instance ? Pin
Paulo Zemek25-Mar-13 9:46
mvaPaulo Zemek25-Mar-13 9:46 
QuestionAny C# library for Forward error correction. Pin
iamraghusunkara25-Mar-13 4:33
iamraghusunkara25-Mar-13 4:33 
AnswerRe: Any C# library for Forward error correction. Pin
Marco Bertschi25-Mar-13 6:17
protectorMarco Bertschi25-Mar-13 6:17 
AnswerRe: Any C# library for Forward error correction. Pin
unclepaul25-Mar-13 10:44
unclepaul25-Mar-13 10:44 
GeneralRe: Any C# library for Forward error correction. Pin
iamraghusunkara25-Mar-13 19:55
iamraghusunkara25-Mar-13 19:55 
QuestionRemote desktop using VNC Pin
superselector25-Mar-13 1:27
superselector25-Mar-13 1:27 
AnswerRe: Remote desktop using VNC Pin
Richard MacCutchan25-Mar-13 1:35
mveRichard MacCutchan25-Mar-13 1:35 
AnswerRe: Remote desktop using VNC Pin
Eddy Vluggen25-Mar-13 2:03
professionalEddy Vluggen25-Mar-13 2:03 
AnswerRe: Remote desktop using VNC Pin
Marco Bertschi25-Mar-13 6:22
protectorMarco Bertschi25-Mar-13 6:22 
Questiondelegate difficulty Pin
Member 993942324-Mar-13 21:45
Member 993942324-Mar-13 21:45 
AnswerRe: delegate difficulty Pin
Abhinav S24-Mar-13 22:29
Abhinav S24-Mar-13 22:29 
GeneralRe: delegate difficulty Pin
Member 993942325-Mar-13 3:42
Member 993942325-Mar-13 3:42 
GeneralRe: delegate difficulty Pin
PIEBALDconsult25-Mar-13 5:01
mvePIEBALDconsult25-Mar-13 5:01 
AnswerRe: delegate difficulty Pin
Paulo Zemek25-Mar-13 5:34
mvaPaulo Zemek25-Mar-13 5:34 
QuestionHow to use databindings class in web application? Pin
behrad kiani24-Mar-13 6:56
behrad kiani24-Mar-13 6:56 
AnswerRe: How to use databindings class in web application? Pin
Dave Kreskowiak24-Mar-13 7:33
mveDave Kreskowiak24-Mar-13 7:33 
AnswerRe: How to use databindings class in web application? Pin
Eddy Vluggen24-Mar-13 23:33
professionalEddy Vluggen24-Mar-13 23:33 

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.