memory leak and process terminated

This is a discussion on memory leak and process terminated within the Linux Programming forums, part of the Platform Specific Boards category; Hi all, I have a question about process exit condition due to memory leak. If no system memory available caused ...

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    16

    memory leak and process terminated

    Hi all,

    I have a question about process exit condition due to memory leak.
    If no system memory available caused by memory leak and that lead to processes termination, what will be the exit code of the affected processes?

    Thanks a lot! :redface

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,767
    man page wait section 2
    It depends how badly the code is written.

    For well-written code that checks for NULL on each malloc, or eventually catches an exception in C++, then I would say some documented non-zero exit status would be appropriate.

    But if it's crap code, it probably crashes out with a segmentation fault.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Dec 2009
    Posts
    16
    Got it! Thank you~

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking if a process has terminated?
    By Elysia in forum Linux Programming
    Replies: 26
    Last Post: 11-22-2011, 06:29 PM
  2. Process Terminated with status -1073741510
    By Varethien in forum C Programming
    Replies: 5
    Last Post: 08-09-2011, 05:16 AM
  3. Process terminated with status -1073741819
    By smithx in forum C Programming
    Replies: 5
    Last Post: 11-02-2010, 12:13 AM
  4. Replies: 2
    Last Post: 09-28-2006, 02:06 PM
  5. memory leak
    By houssam_ballout in forum C++ Programming
    Replies: 12
    Last Post: 05-20-2006, 03:09 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21