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

JVM_OnLoad function called after most of JDK classes are loaded

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, windows_2000

      Description



      Name: yyT116575 Date: 12/21/2000


      java version "1.3.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
      Java HotSpot(TM) Client VM (build 1.3.0_01, mixed mode)


      I'm using JVMPI interface and I discovered the following problem:
      JVM_OnLoad function is called after the most of JDK classes are already loaded.
      As a result during the application profiling I get JVMPI_EVENT_OBJECT_ALLOC
      events which related to classes I can't recognize (I didn't get
      JVMPI_EVENT_CLASS_LOAD event for them.

        To reproduce the problem do the following:
      1. create profiling dll, here the code of the simple profiling dll:

      #include <jvmpi.h>
      #include <jni.h>

      JNIEXPORT jint JNICALL JVM_OnLoad(JavaVM *jvm, char *options, void *reserved)
      {
        printf("Inside JVM_OnLoad...");
        return JNI_OK;
      }

      2. run java with your profiling dll (-Xrun... option) and with -verbose option.
      You don't need even java application to be specified to see the problem.
      > java -Xrun... -verbose

      3. You will see that "Inside JVM_OnLoad..." message will appear after JDK
      classes loading messages. Here is example of output:

      [Opened C:\Program Files\JavaSoft\JRE\1.3.0_01\lib\rt.jar]
      [Opened C:\Program Files\JavaSoft\JRE\1.3.0_01\lib\i18n.jar]
      [Opened C:\Program Files\JavaSoft\JRE\1.3.0_01\lib\sunrsasign.jar]
      [Loaded java.lang.Object from ...rt.jar]
      ...
      [Loaded sun.misc.Launcher$3 from ...rt.jar]
      [Loaded sun.net.www.protocol.file.Handler from ...rt.jar]
      Inside JVM_OnLoad...
      Usage: java [-options] class [args...]
                 (to execute a class)
         or java -jar [-options] jarfile [args...]
                 (to execute a jar file)

      where options include:
          -cp -classpath <directories and zip/jar files separated by ;>
                        set search path for application classes and resources
          -D<name>=<value>
                        set a system property
          -verbose[:class|gc|jni]
                        enable verbose output
          -version print product version and exit
          -showversion print product version and continue
          -? -help print this help message
          -X print help on non-standard options
      [Loaded java.lang.Shutdown$Lock from ...rt.jar]


      It's important to mention that "classic" JVM doesn't have this problem (It has
      a lot of others :) ).
      (Review ID: 114138)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              yyoungsunw Yung-ching Young (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: