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

C#

 
QuestionHow to get Image from Frame in mshtml. Pin
banker_kiran4-Jul-08 20:04
banker_kiran4-Jul-08 20:04 
AnswerRe: How to get Image from Frame in mshtml. Pin
banker_kiran8-Jul-08 18:47
banker_kiran8-Jul-08 18:47 
QuestionStop Autoplay of mshtml.HTMLObjectElement Pin
banker_kiran4-Jul-08 19:31
banker_kiran4-Jul-08 19:31 
QuestionPrinting on a Pre-Printed Form Pin
Ian Uy4-Jul-08 18:20
Ian Uy4-Jul-08 18:20 
AnswerRe: Printing on a Pre-Printed Form Pin
Nader Elshehabi4-Jul-08 23:54
Nader Elshehabi4-Jul-08 23:54 
GeneralRe: Printing on a Pre-Printed Form Pin
Ian Uy5-Jul-08 3:32
Ian Uy5-Jul-08 3:32 
QuestionHow much memory do uninitialized array take up? Pin
gigahertz2054-Jul-08 14:48
gigahertz2054-Jul-08 14:48 
AnswerRe: How much memory do uninitialized array take up? [modified] Pin
Luc Pattyn4-Jul-08 15:13
sitebuilderLuc Pattyn4-Jul-08 15:13 
An uninitialized array is an object with all data set to zero/null, which can be served by
one or more "demand zero" pages, i.e. it gets allocated in the page tables, but does not
require physical memory pages yet.

As soon as some of its data is needed (read or write) a page error will occur, and the MMU
(Memory Management Unit, a hardware part of modern CPUs) will, with the help of some OS code,
allocate physical memory for that page, and then fill it with zeroes.

BTW the page size typically is 4KB

Conclusion: an unitialized array is as expensive as a small object, no more, no less.

Value types are:
[ADDED]
- either local types
- or value members of some other type (such as an int inside a class object).

Local value types are [/ADDED] allocated on the stack, so they consume memory corresponding to their size
(although the stack too is virtual, i.e. if you allocate a huge struct, spanning many pages,
most of these pages again would not be allocated immediately).
There is no such thing as an uninitialized value type, every value type starts of with some
value; typically the language definition and compiler enforce this; example: in a struct
your constructor must assign a value to every member.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Voting for dummies? No thanks. Dead | X|


modified on Friday, July 4, 2008 10:41 PM

GeneralRe: How much memory do uninitialized array take up? Pin
N a v a n e e t h4-Jul-08 16:27
N a v a n e e t h4-Jul-08 16:27 
GeneralRe: How much memory do uninitialized array take up? Pin
Luc Pattyn4-Jul-08 16:34
sitebuilderLuc Pattyn4-Jul-08 16:34 
GeneralRe: How much memory do uninitialized array take up? Pin
N a v a n e e t h4-Jul-08 16:42
N a v a n e e t h4-Jul-08 16:42 
AnswerRe: How much memory do uninitialized array take up? Pin
N a v a n e e t h4-Jul-08 16:35
N a v a n e e t h4-Jul-08 16:35 
GeneralRe: How much memory do uninitialized array take up? Pin
Luc Pattyn4-Jul-08 16:44
sitebuilderLuc Pattyn4-Jul-08 16:44 
GeneralRe: How much memory do uninitialized array take up? Pin
N a v a n e e t h4-Jul-08 16:47
N a v a n e e t h4-Jul-08 16:47 
GeneralRe: How much memory do uninitialized array take up? Pin
Guffa5-Jul-08 4:00
Guffa5-Jul-08 4:00 
GeneralRe: How much memory do uninitialized array take up? Pin
N a v a n e e t h5-Jul-08 16:33
N a v a n e e t h5-Jul-08 16:33 
AnswerRe: How much memory do uninitialized array take up? Pin
Guffa5-Jul-08 3:55
Guffa5-Jul-08 3:55 
Questionhow to enable wave out mixer or stero mixer option using c# Pin
theredonion4-Jul-08 10:49
theredonion4-Jul-08 10:49 
QuestionEncrypted string changed when Serialized [modified] Pin
DaveyM694-Jul-08 10:03
professionalDaveyM694-Jul-08 10:03 
AnswerRe: Encrypted string changed when Serialized Pin
Guffa4-Jul-08 12:28
Guffa4-Jul-08 12:28 
GeneralRe: Encrypted string in dictionary Pin
DaveyM694-Jul-08 22:03
professionalDaveyM694-Jul-08 22:03 
GeneralRe: Encrypted string in dictionary Pin
DaveyM694-Jul-08 22:07
professionalDaveyM694-Jul-08 22:07 
QuestionWeb service and multithreading Pin
Le centriste4-Jul-08 9:02
Le centriste4-Jul-08 9:02 
AnswerRe: Web service and multithreading Pin
DaveyM694-Jul-08 10:09
professionalDaveyM694-Jul-08 10:09 
GeneralRe: Web service and multithreading Pin
Le centriste7-Jul-08 5:46
Le centriste7-Jul-08 5:46 

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.