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

-Dsun.net.maxDatagramSockets=1 does not work correctly with system.gc()

XMLWordPrintable

    • b08
    • x86
    • windows_xp
    • Verified

        When System.gc() is launched in a test program, the test program creates Sockets
        more than the limit specified in -Dsun.net.maxDatagramSockets.

        CONFIGURATION:
        OS :WinXP(SP3, Japanese, x86)
        JDK : JDK7GA
        java version "1.7.0"
        Java(TM) SE Runtime Environment (build 1.7.0-b147)
        Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode)

        REPRODUCE:
        1. Compile the attached Limit.java
           (javac -Xlint:deprecation Limit.java)
        2. jar -cvf J800275.jar *.class
        3. del *.class
        4. java -Djava.security.policy=Limit.policy -Dsun.net.maxDatagramSockets=1 -cp J800275.jar Limit

        The message shows up,

        Exception in thread "main" java.lang.RuntimeException: Test failed (a): limit was set to 1
                at Limit.main(Limit.java:33)

        Please see comment section for a little bit more detail.

              michaelm Michael McMahon
              tbaba Tadayuki Baba (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: