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

C#

 
GeneralProblem sending a public key encrypted string over a socket Pin
anth12320-Apr-08 13:04
anth12320-Apr-08 13:04 
GeneralChanging propertie on other form. Pin
RitchieRich20-Apr-08 12:05
RitchieRich20-Apr-08 12:05 
GeneralRe: Changing propertie on other form. Pin
Christian Graus20-Apr-08 12:11
protectorChristian Graus20-Apr-08 12:11 
GeneralRe: Changing propertie on other form. Pin
cocoonwls20-Apr-08 20:21
cocoonwls20-Apr-08 20:21 
GeneralRe: Changing propertie on other form. [modified] Pin
RitchieRich20-Apr-08 23:48
RitchieRich20-Apr-08 23:48 
GeneralRe: Changing propertie on other form. Pin
cocoonwls22-Apr-08 18:32
cocoonwls22-Apr-08 18:32 
GeneralRender Vista Style ComboBox Pin
Lea Hayes20-Apr-08 10:03
Lea Hayes20-Apr-08 10:03 
GeneralRe: Render Vista Style ComboBox Pin
badtoto24-Dec-08 18:40
badtoto24-Dec-08 18:40 
GeneralRe: Render Vista Style ComboBox Pin
Lea Hayes26-Dec-08 8:16
Lea Hayes26-Dec-08 8:16 
Generalinsert images in rtf file Pin
panoskatws20-Apr-08 7:30
panoskatws20-Apr-08 7:30 
GeneralRe: insert images in rtf file Pin
mav.northwind20-Apr-08 7:44
mav.northwind20-Apr-08 7:44 
GeneralLoading an Icon Resource [modified] Pin
#realJSOP20-Apr-08 4:35
professional#realJSOP20-Apr-08 4:35 
GeneralRe: Loading an Icon Resource Pin
Scott Dorman20-Apr-08 4:50
professionalScott Dorman20-Apr-08 4:50 
GeneralRe: Loading an Icon Resource Pin
#realJSOP20-Apr-08 5:07
professional#realJSOP20-Apr-08 5:07 
GeneralRe: Loading an Icon Resource Pin
Scott Dorman20-Apr-08 5:14
professionalScott Dorman20-Apr-08 5:14 
GeneralRe: Loading an Icon Resource Pin
#realJSOP20-Apr-08 5:41
professional#realJSOP20-Apr-08 5:41 
GeneralRe: Loading an Icon Resource Pin
Scott Dorman20-Apr-08 6:44
professionalScott Dorman20-Apr-08 6:44 
QuestionSorting data using BindingSource.Sort Pin
Alessandra7720-Apr-08 4:04
Alessandra7720-Apr-08 4:04 
QuestionOutofMemoryException Pin
Ian Grech20-Apr-08 2:57
Ian Grech20-Apr-08 2:57 
GeneralRe: OutofMemoryException Pin
Luc Pattyn20-Apr-08 3:10
sitebuilderLuc Pattyn20-Apr-08 3:10 
GeneralRe: OutofMemoryException Pin
Jordanwb20-Apr-08 4:09
Jordanwb20-Apr-08 4:09 
GeneralRe: OutofMemoryException Pin
Luc Pattyn20-Apr-08 13:08
sitebuilderLuc Pattyn20-Apr-08 13:08 
GeneralRe: OutofMemoryException Pin
Jordanwb20-Apr-08 13:24
Jordanwb20-Apr-08 13:24 
GeneralRe: OutofMemoryException Pin
Luc Pattyn20-Apr-08 14:07
sitebuilderLuc Pattyn20-Apr-08 14:07 
GeneralRe: OutofMemoryException Pin
Jordanwb20-Apr-08 15:46
Jordanwb20-Apr-08 15:46 
Luc Pattyn wrote:
the OP and my first reply were about boxing, and how it turns a little bool into a full-fledged object.


Gotcha

Luc Pattyn wrote:
I am convinced the smallest amount of information you can store is a bit, and nowadays 8 of them typically fit into a byte. And most microprocessors have assembly instructions to operate on a single bit into a larger memory byte or word.


You are correct, but this limitation is not artifical. When you create a bool type variable in memory you allocate a complete byte to it even though you're using only one bit of data for the actual value. The other 7 bits are completly wasted and you can't use them again until the bool is destroyed by garbage collection. For example: In my compuer I have ~1280 MB (1.25 GB) of RAM. That means that I can have a maximum of 2061584302080 bools (1280 * 1024 * 1024), not 16492674416640 (1280 * 1024 * 1024 * 8) [Re-reads your message] I think we're both saying the same thing but in a very different manner.

Luc Pattyn wrote:
But I am a bit puzzled how all of this became relevant in this thread.


It's relevant because we're talking about OutOfMemoryExceptions. The dude is using to much memory and he doesn't know why. A few weeks ago I had a near exact problem. He was creating a Dictionary that - I assume - maps a key to a value. He had 2147483647 records in the dictionary. 2147483647 Int's each using four bytes equates to ~8 GB of RAM. Don't forget the space that bools take up which is 2147483647 bools each taking a byte / 1024 / 1024 equates to ~2 GB. He wants 10 Gigs of Memory.

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.