Click here to Skip to main content
15,906,816 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Questions about Framework 2.0 Garbage Collection and Memory Management Pin
Dan Neely23-Aug-06 4:29
Dan Neely23-Aug-06 4:29 
AnswerRe: Questions about Framework 2.0 Garbage Collection and Memory Management Pin
Dan Neely23-Aug-06 4:31
Dan Neely23-Aug-06 4:31 
AnswerRe: Questions about Framework 2.0 Garbage Collection and Memory Management [modified] Pin
Mike Dimmick23-Aug-06 10:23
Mike Dimmick23-Aug-06 10:23 
AnswerRe: Questions about Framework 2.0 Garbage Collection and Memory Management Pin
Scott Dorman1-Sep-06 15:57
professionalScott Dorman1-Sep-06 15:57 
QuestionWhy reference variables are stored on heap Pin
karan vidyut23-Aug-06 1:57
karan vidyut23-Aug-06 1:57 
AnswerRe: Why reference variables are stored on heap Pin
Jun Du23-Aug-06 4:41
Jun Du23-Aug-06 4:41 
AnswerRe: Why reference variables are stored on heap Pin
Colin Angus Mackay24-Aug-06 2:27
Colin Angus Mackay24-Aug-06 2:27 
AnswerRe: Why reference variables are stored on heap Pin
Guffa24-Aug-06 3:17
Guffa24-Aug-06 3:17 
Reference types (e.g. objects) are always stored in the heap.

Value types declared inside a class is stored inside the object data on the heap.

Value types declared as local variables in a method are stored on the stack.

If reference types would be stored on the stack, they would live exactly as long as the method call where they are created. They could not be freed earlier and not survive after. Also the stack has a limited size (2 MiB by default, IIRC) and can not be expanded at runtime.

If local variables would be stored on the heap, it would mean that most method calls would allocate memory on the heap, vastly increasing the heap turnover and adding a lot of overhead.


---
b { font-weight: normal; }

QuestionSend page by email Pin
sujasmaill22-Aug-06 22:04
sujasmaill22-Aug-06 22:04 
QuestionProblem hosting webpage on server/ domain Pin
sandeep kumar pundhir22-Aug-06 19:57
sandeep kumar pundhir22-Aug-06 19:57 
AnswerRe: Problem hosting webpage on server/ domain Pin
Mike Dimmick23-Aug-06 0:25
Mike Dimmick23-Aug-06 0:25 
QuestionSystem Administration for Windows Pin
Mostafa Siraj22-Aug-06 10:48
Mostafa Siraj22-Aug-06 10:48 
AnswerRe: System Administration for Windows Pin
Jun Du23-Aug-06 4:46
Jun Du23-Aug-06 4:46 
GeneralRe: System Administration for Windows Pin
Mostafa Siraj23-Aug-06 8:13
Mostafa Siraj23-Aug-06 8:13 
Questionhow to make a dbx file Pin
Parshant Verma22-Aug-06 0:18
Parshant Verma22-Aug-06 0:18 
QuestionPassing Data from ASP.NET to Axis Web Service Pin
bryan paling21-Aug-06 19:24
bryan paling21-Aug-06 19:24 
AnswerRe: Passing Data from ASP.NET to Axis Web Service Pin
stevepham4225-Aug-06 0:22
stevepham4225-Aug-06 0:22 
QuestionRunning other Applications (exe) Pin
Md.Imdad21-Aug-06 10:41
Md.Imdad21-Aug-06 10:41 
AnswerRe: Running other Applications (exe) Pin
Jun Du22-Aug-06 12:44
Jun Du22-Aug-06 12:44 
QuestionASP .NET Datagrid SQL SELECT Parameter Problem Pin
Soot21-Aug-06 9:57
Soot21-Aug-06 9:57 
QuestionLarge Heap Doesn't Compact? Pin
BarV21-Aug-06 8:28
BarV21-Aug-06 8:28 
AnswerRe: Large Heap Doesn't Compact? Pin
Dave Kreskowiak21-Aug-06 8:44
mveDave Kreskowiak21-Aug-06 8:44 
GeneralRe: Large Heap Doesn't Compact? Pin
BarV21-Aug-06 8:58
BarV21-Aug-06 8:58 
AnswerRe: Large Heap Doesn't Compact? Pin
Guffa21-Aug-06 8:47
Guffa21-Aug-06 8:47 
GeneralRe: Large Heap Doesn't Compact? Pin
BarV21-Aug-06 8:59
BarV21-Aug-06 8:59 

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.