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

MAC: Performance improvement using madvise

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 9
    • 7u4
    • hotspot
    • generic
    • os_x

      This bug shadows a JIRA bug created for the Mac OS X port at...

      http://java.net/jira/browse/MACOSX_PORT-430

      Here is the description from that bug:

      Ia simple performance improvement.

      os_bsd.cpp has:
      static int anon_munmap(char * addr, size_t size) { return ::munmap(addr, size) == 0; }
      before the ::munmap() we should add:
      int ret = madvise(addr, size, MADV_FREE);
      assert(ret == 0, "os::uncommit_memory: madvise failed");

      the meaning of MADV_FREE on mac os is:
      #define MADV_FREE 5 /* pages unneeded, discard contents */
      MADV_FREE Indicates that the application will not need the
      information contained in this address range, so the
      pages may be reused right away. The address range
      will remain valid. This is used with madvise()
      system call.

      The main difficulty of adding this is to figure out which os variations support madvise and to introduce any necessary conditional compilation.

            Unassigned Unassigned
            jmelvin James Melvin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: