Click here to Skip to main content
15,895,192 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Multiple list boxes in main window Pin
PJ Arends20-Feb-07 11:46
professionalPJ Arends20-Feb-07 11:46 
GeneralRe: Multiple list boxes in main window Pin
Demosthenes Tecumseh20-Feb-07 12:10
Demosthenes Tecumseh20-Feb-07 12:10 
JokeRe: Multiple list boxes in main window Pin
Mark Salsbery20-Feb-07 12:41
Mark Salsbery20-Feb-07 12:41 
AnswerRe: Multiple list boxes in main window Pin
Stephen Hewitt20-Feb-07 12:43
Stephen Hewitt20-Feb-07 12:43 
GeneralRe: Multiple list boxes in main window Pin
Demosthenes Tecumseh20-Feb-07 13:44
Demosthenes Tecumseh20-Feb-07 13:44 
GeneralRe: Multiple list boxes in main window Pin
PJ Arends20-Feb-07 15:29
professionalPJ Arends20-Feb-07 15:29 
AnswerRe: Multiple list boxes in main window Pin
Demosthenes Tecumseh20-Feb-07 14:01
Demosthenes Tecumseh20-Feb-07 14:01 
QuestionMemory Allocation/Deallocation issues?? Pin
pavanbabut20-Feb-07 9:42
pavanbabut20-Feb-07 9:42 
I am having some weired situation going on in my VC++ program when I allocate and deallocate memory wihtin the application. Lemme explain the scenario, I am having an applicaiton where I allocate memory to a variable (which are initialized to NULL when the program starts) whenever the user requests and only deallocates it when the user requests the same variable again where I reallocate the memory again. But when I deallocate the memory it is not releasing the whole memory that I have allocated it before.

For example-

My program starts with total mem usage of 92596 bytes (At this point I haven't allocated any memory to those variables)
When I allocate memory to the first variable using either GlobalAlloc or VirtualAlloc it increases by 94752 bytes which equals to ~2000bytes
When I deallocate the memory using either GlobalFree or VirtualFree it is deallocating only half of the memory ~1000bytes
Now When I reallocate the memory in the same way as above, it is allocating new 2000bytes.
So, in this way slowly the memory being used by my program is increasing drastically after a while, as I sometimes allocate about 225 variables of ~2000bytes each.
But when I deallocate the memory of the same variables when I am exiting the application it does deallocate ~2000bytes of each variable.

Is there something I am doing wrong??Confused | :confused:

thanks.
-Pavan
AnswerRe: Memory Allocation/Deallocation issues?? Pin
Mark Salsbery20-Feb-07 10:05
Mark Salsbery20-Feb-07 10:05 
AnswerRe: Memory Allocation/Deallocation issues?? Pin
Blake Miller20-Feb-07 10:21
Blake Miller20-Feb-07 10:21 
GeneralRe: Memory Allocation/Deallocation issues?? Pin
pavanbabut20-Feb-07 11:40
pavanbabut20-Feb-07 11:40 
AnswerRe: Memory Allocation/Deallocation issues?? Pin
Mark Salsbery20-Feb-07 12:17
Mark Salsbery20-Feb-07 12:17 
GeneralRe: Memory Allocation/Deallocation issues?? Pin
pavanbabut20-Feb-07 13:21
pavanbabut20-Feb-07 13:21 
AnswerRe: Memory Allocation/Deallocation issues?? Pin
Maximilien20-Feb-07 13:37
Maximilien20-Feb-07 13:37 
GeneralRe: Memory Allocation/Deallocation issues?? Pin
pavanbabut20-Feb-07 13:41
pavanbabut20-Feb-07 13:41 
Question[Message Deleted] Pin
Anil K P20-Feb-07 7:48
Anil K P20-Feb-07 7:48 
AnswerRe: Get Background color of an active wondow in MFC program Pin
David Crow20-Feb-07 7:52
David Crow20-Feb-07 7:52 
QuestionRe: Get Background color of an active wondow in MFC program Pin
Mark Salsbery20-Feb-07 8:02
Mark Salsbery20-Feb-07 8:02 
AnswerRe: Get Background color of an active wondow in MFC program Pin
toxcct20-Feb-07 8:47
toxcct20-Feb-07 8:47 
GeneralMigration VC++ Pin
world.wild.web20-Feb-07 7:41
world.wild.web20-Feb-07 7:41 
GeneralRe: Migration VC++ Pin
Mark Salsbery20-Feb-07 8:08
Mark Salsbery20-Feb-07 8:08 
GeneralRe: Migration VC++ Pin
Hamid_RT20-Feb-07 18:30
Hamid_RT20-Feb-07 18:30 
GeneralRe: Migration VC++ Pin
Anilkumar K V20-Feb-07 23:44
Anilkumar K V20-Feb-07 23:44 
GeneralRe: Migration VC++ Pin
world.wild.web21-Feb-07 3:07
world.wild.web21-Feb-07 3:07 
QuestionDetecting Unicode Fonts using Win32 API Pin
Dave_Roach20-Feb-07 6:41
Dave_Roach20-Feb-07 6:41 

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.