Memory leaks

Discussion in 'Mac Programming' started by bahlquist, Oct 16, 2010.

  1. bahlquist macrumors member

    Oct 6, 2010
    If you fail to release memory in a program, what is the worst that can happen? Is it just the case that you must shutdown the computer to release the memory, or can you have more significant problems?
  2. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    Nothing of that severity at all. When your program exits, the memory is returned to the system. Worst case users have to restart your program as it gets bloaty, and they get sick of doing so, and stop using your program. You're not going to do anything to hardware, etc.


    EDIT: I guess if you leak badly enough that the system exhausts RAM and swap then the OS will no longer be able to grant requests for memory, and the system will start behaving oddly. This is the most extreme case, but it happens.

Share This Page