Thread: What can happen if you forget to deallocate memory?

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Cactus_Hugger View Post
    Depends completely on the computer, OS, and what's in the system at the time.
    What if the page file is full? (or non-existant?) Granted, in Windows, the page file seems to be unbounded in limit (probably a tweak somewhere I don't know, but my pagefile seems to be 4GB at the moment...) Now, my Linux box, the swap will not grow to infinity - there's are hard limit at ~1.5GB, RAM + swap combined. Less if I turn swap off. The man pages state this:
    True. OS dependant. But it would show that every OS does not behave the same, so in sense, the original statement that it would starve all other applications is untrue.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Hmm, that issue is kind of lame.

  3. #18
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    I have been running Linux on my computer with 2GB ram without any swap for quite a few months and no problems so far =).

  4. #19
    ---
    Join Date
    May 2004
    Posts
    1,379
    No swap at all? Why?
    I have a 1GB swap partition on mine and according to gkrellm it barely gets used but still, why not swap?

  5. #20
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    I used to have a swap partition, but I have never seen it used at all, so I thought I don't need it =). I have a ram usage monitor on my gnome desktop and I have never seen the ram usage go above 1GB (disk cache doesn't count), except when I run something I write that leaks memory like crazy =). It makes my partition table simpler.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 02-06-2009, 12:27 PM
  2. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  3. Accessing Video Memory Information...need help
    By KneeLess in forum C++ Programming
    Replies: 8
    Last Post: 08-24-2003, 03:53 PM
  4. Is it necessary to write a specific memory manager ?
    By Morglum in forum Game Programming
    Replies: 18
    Last Post: 07-01-2002, 01:41 PM
  5. What's the best memory (RAM) type?
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 12-15-2001, 12:37 AM

Tags for this Thread