XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.2
    • None
    • native
    • None
    • Any UNIX system other than Linux

    Description

      HDFS uses mlock() to lock in the memory used to back java.nio.Buffer. Unfortunately the way it is done is not standards-compliant. As the Linux manpage for mlock() says:

      Under Linux, mlock(), mlock2(), and munlock() automatically round
      addr down to the nearest page boundary. However, the POSIX.1
      specification of mlock() and munlock() allows an implementation to
      require that addr is page aligned, so portable applications should
      ensure this.

      The HDFS code does not do any such alignment, nor is it true that the backing buffers for java.nio.Buffer are necessarily page aligned. And even if the address was aligned by the code, it would end up calling mlock() on other random JVM data structures that shared the same page. That seems potentially dangerous.

      Attachments

        Issue Links

          Activity

            People

              alanburlison Alan Burlison
              alanburlison Alan Burlison
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: