Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

CroMagnon

Is Dynamic Memory Allocation worth it?

This topic is 6089 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Will memory on a users harddrive be lockedup permanently if the user ran a program that was programed using Dynamic Memory Allocation (C(malloc, free),C++(New, Delete)) and the user shut off the program or computer before the program could free the memory it had dynamically allocated or the program wasn''t programmed to free it? if(Yes the memory is lockedup permanently) { "Does the user need to go so far as to format the harddrive and reinstall the OS and everything to get the memory back?" "Is programming with linked lists and Dynamic Memory Allocation styles worth it?" "I am not sure but I think I just lost most of the free space on my (old == 1995) computer because I ran another programmer''s reckless program. Is Dynamic Memory Allocation worth it when the user has a 40G HardDrive? or does it eat up the space fast?" } else // No it isn''t permanent { "Does the computer delete the space the next time it starts up?" "Does the computer store the data as temporary somewhere like "C:\WINDOWS\TEMP" ?" }

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
i think you''re a bit lost, i hope you are talking about virtual memory(swap space) because harddrive space and memory are two different things entirely. maybe read a introductory c book and you will find some answers. btw, the space on the hard drive will not be "locked up", if you find that you are running out of space for no apparent reason, run scandisk and see if it fixes any problems.

Share this post


Link to post
Share on other sites
Are you are saying that (heap, free store, dynamic memory allocated data) is stored in Random Active Memory? Oh Ok I got the impression from the two books I have read that it was stored on the HardDrive. I just reread them and they use the word "Memory".

Share this post


Link to post
Share on other sites
Random Access Memory
Yes, that''s where it''s stored. (Except when the OS decides to use the swapfile, but that''s not something you need to be concerned with).

~~~~~~~~~~
Martee

Share this post


Link to post
Share on other sites
Most modern OS''s will free any allocated memory when the program exits even if the program doesn''t explicitly free the memory itself. If the program crashes however, there is a possibility that the system can''t release the memory.

It is *always* freed when rebooting though.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!