Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6231214

os::malloc() should fail more gracefully

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 6
    • 6
    • hotspot
    • None
    • generic
    • generic

      Many JVM crashes reported by customers have been traced down to running the machine out of swap space or available address space. One type of failure that can easily and should be fixed is the situation where os::malloc() is about to return NULL. There are many code paths through the JVM (handle allocation being one recently encountered) which call malloc() and expect a non-NULL result, and if malloc() fails for any reason the JVM will crash at a random point. We should at least add code to os::malloc() to check for a NULL return value and call vm_exit_out_of_memory() or similar to produce an error log indicating the cause of the crash.

      6223676 is a recent occurrence of this problem. It is probably related to 4719004 but is not exactly the same.

      ###@###.### 2005-2-19 02:30:54 GMT

            duke J. Duke
            kbr Kenneth Russell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: