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

Memory leak in Java Solaris native code when calling NetworkInterface.getHardwareAddress()

XMLWordPrintable

    • b01

        The getHardwareAddress method in NetworkInterface has a call to native method getMacAddr0 and which inturn invokes getMacAddress. In getMacAddress there is solaris specific call to getMacFromDevice which make a call to
        open the device for which the address is to be retrieved(fd = open(style1dev,
        O_RDWR)). But this fd is never getting closed in this method (neither returned
        from excpetion nor in the normal flow as well). So if multiple devices are present and
        each read will result in new fd getting created and will result in memory
        loss. This requires a fix in JDK, where we have to close the fd before the
        method getMacFromDevice exit.

              jjose Johny Jose
              shadowbug Shadow Bug
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: