Click here to Skip to main content
15,891,951 members
Home / Discussions / C#
   

C#

 
QuestionHow to do code optimization in c# apps Pin
Tridip Bhattacharjee25-Mar-13 9:30
professionalTridip Bhattacharjee25-Mar-13 9:30 
GeneralRe: How to do code optimization in c# apps Pin
harold aptroot25-Mar-13 10:41
harold aptroot25-Mar-13 10:41 
AnswerRe: How to do code optimization in c# apps Pin
jschell26-Mar-13 8:39
jschell26-Mar-13 8:39 
QuestionFew question about static class c# Pin
Tridip Bhattacharjee25-Mar-13 5:01
professionalTridip Bhattacharjee25-Mar-13 5:01 
AnswerRe: Few question about static class c# Pin
PIEBALDconsult25-Mar-13 5:14
mvePIEBALDconsult25-Mar-13 5:14 
AnswerRe: Few question about static class c# Pin
Paulo Zemek25-Mar-13 5:39
mvaPaulo Zemek25-Mar-13 5:39 
GeneralRe: Few question about static class c# Pin
Tridip Bhattacharjee25-Mar-13 8:43
professionalTridip Bhattacharjee25-Mar-13 8:43 
GeneralRe: Few question about static class c# Pin
Paulo Zemek25-Mar-13 9:36
mvaPaulo Zemek25-Mar-13 9:36 
GeneralRe: Few question about static class c# Pin
harold aptroot25-Mar-13 9:50
harold aptroot25-Mar-13 9:50 
AnswerRe: Few question about static class c# Pin
Marco Bertschi25-Mar-13 6:12
protectorMarco Bertschi25-Mar-13 6:12 
GeneralRe: Few question about static class c# Pin
Tridip Bhattacharjee25-Mar-13 8:46
professionalTridip Bhattacharjee25-Mar-13 8:46 
GeneralRe: Few question about static class c# Pin
Marco Bertschi25-Mar-13 9:35
protectorMarco Bertschi25-Mar-13 9:35 
GeneralRe: Few question about static class c# Pin
Tridip Bhattacharjee25-Mar-13 9:53
professionalTridip Bhattacharjee25-Mar-13 9:53 
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 

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.