Memory leaks

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

  1. macrumors member

    Joined:
    Oct 6, 2010
    #1
    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. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    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.

    -Lee

    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