free store (heap) question
when we use new to create variables they r from the heap, a where memory was set aside for dynamic variables.. how much of this FREE STORE is avaliable out of the whole memory ? like let''s say 256 ram .. how much % is heap ? and when it runs out of heap what happens ?
Metal Typhoon
quote:Original post by Metal TyphoonDepends on how much your OS and other applications have already gobbled up. If no other apps are running and your OS takes, say, 32MB, then you have 224MB available as free store. Naturally, you''re not expected to use all of it.
how much of this FREE STORE is avaliable out of the whole memory? like let''s say 256 ram .. how much % is heap?
quote:.. and when it runs out of heap what happens ?Most systems today have something called virtual memory, where a file is used as extra pseudo-RAM, allowing your system to pretend to have more RAM than it actually does. This allows more applications than the RAM can accomodate to run simultaneously, by writing the contents of memory of a non-active application to file (simplified explanation) and reading them back in when the app regains focus/is reactivated. Sometimes you notice a slight pause when you switch apps on some computers? That''s memory being swapped in from and out to file.
quote:Original post by OluseyiDepends on how much your OS and other applications have already gobbled up. If no other apps are running and your OS takes, say, 32MB, then you have 224MB available as free store. Naturally, you''re not expected to use all of it.Original post by Metal Typhoon
how much of this FREE STORE is avaliable out of the whole memory? like let''s say 256 ram .. how much % is heap?
quote:.. and when it runs out of heap what happens ?Most systems today have something called virtual memory, where a file is used as extra pseudo-RAM, allowing your system to pretend to have more RAM than it actually does. This allows more applications than the RAM can accomodate to run simultaneously, by writing the contents of memory of a non-active application to file (simplified explanation) and reading them back in when the app regains focus/is reactivated. Sometimes you notice a slight pause when you switch apps on some computers? That''s memory being swapped in from and out to file.
thank you so much now i understand this :D
Metal Typhoon
Unless of course, if you write programs for consoles where there are no virtual memory. Then it is just to bad if you run out of memory - the system just crashes. Bang!
Jacob Marner, M.Sc.
Console Programmer, Deadline Games
Jacob Marner, M.Sc.
Console Programmer, Deadline Games
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement