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

InetAddress.isReachable() leaves open handles after execution

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      01
    • CPU:
      x86
    • OS:
      windows_2000

      Backports

        Description



        Name: jl125535 Date: 08/03/2004


        FULL PRODUCT VERSION :
        java version "1.5.0-beta3"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b59)
        Java HotSpot(TM) Client VM (build 1.5.0-beta3-b59, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows 2000 [Versione 5.00.2195]

        A DESCRIPTION OF THE PROBLEM :
        Both builds "b58" and "b59" of j2sdk 1.5.0 are displaying behavior similar to that described by bug 5061568.

        Snapshot version 1.5.0 b58 indicates that this bug has been fixed.

        Here is the problem I found.

        I executed isReachable on a list of different hosts and using taskmanager I found that there are handles never closed.
        Using a better inspector instrumentation, like "process explorer" by sysinternals.com, I found that the opened handles are simply opened sockets.
        So I think that the problem depicted by bug 5061568 has not been resolved

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        just write a simple program that check isReachable on a list of different hosts. If you see handle count of the process, it never decrease!

        launch the given test case as
        > java Test host1 host2 host3 host4 host5 host6 host7

        It pings regurarly these hosts then asks to press "enter". So I can check if handles have been closed with a monitoring program.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.net.*;

        class Test{
          public static void main(String[] args){
            while(true)
            try{
              System.out.println("GO ON? press enter!");
              System.in.read();
              System.in.read();

              for(int i=0; i<args.length; i++){
                InetAddress inet = InetAddress.getByName(args[i]);
                System.out.print(args[i]+" is reachable? ");
                System.out.print(inet.isReachable(3000));
                inet = null;
                System.out.println();
              }
              System.gc();
            }catch(Exception e){
              e.printStackTrace();
            }
          }
        }

        ---------- END SOURCE ----------
        (Incident Review ID: 289950)
        ======================================================================

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jccollet Jean-Christophe Collet (Inactive)
                Reporter:
                jleesunw Jon Lee (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: