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

[premain] Spring rest-service hangs with -XX:+LoadCachedCode

XMLWordPrintable

      When running https://spring.io/guides/gs/rest-service/ in the "5 step" workflow, the production run produces the expected output, but seems to hang at VM exit:

      $ /jdk3/bld/le4-product/images/jdk/bin/java -Xlog:init -DautoQuit=true -Dspring.output.ansi.enabled=NEVER -Dserver.port=0 -Dspring.aot.enabled=true --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED -Xlog:scc*=warning,cds:file=SpringRest.final.log -XX:SharedArchiveFile=SpringRest.dynamic.jsa -XX:+ReplayTraining -XX:+LoadCachedCode -XX:CachedCodeFile=SpringRest.code.jsa -cp /var/tmp/jib-iklam/download/com/example/rest-service/0.0.1-SNAPSHOT/rest-service-0.0.1-20231011.214536-1.jar org.springframework.boot.loader.JarLauncher
      [0.030s][warning][scc] 820 'java.lang.invoke.MethodHandle.setAsTypeCache(Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandle;' (L2): Lookup failed for klass java.lang.ref.SoftReference: not initialized
      [0.030s][warning][scc] 820 'java.lang.invoke.MethodHandle.setAsTypeCache(Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandle;' (L2): Lookup failed for klass java.lang.ref.SoftReference: not initialized
      [0.036s][warning][scc] 1327 'java.lang.invoke.MethodHandle.asType(Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;' (L2): Lookup failed for holder java.lang.ref.SoftReference: not linked
      [0.072s][warning][scc] 2207 'jdk.internal.loader.URLClassPath$JarLoader.ensureOpen()V' (L2): Lookup failed for klass java.io.IOException: not initialized
      [0.073s][warning][scc] 1034 'jdk.internal.loader.BuiltinClassLoader.findMiscResource(Ljava/lang/String;)Ljava/util/List;' (L2): Lookup failed for klass java.io.IOException: not initialized
      [0.074s][warning][scc] 2049 'org.springframework.boot.loader.jar.Handler.setUseFastConnectionExceptions(Z)V' (L2): Lookup failed for klass org.springframework.boot.loader.jar.JarURLConnection: not initialized
      [0.101s][warning][scc] 2324 'java.lang.Thread.getContextClassLoader()Ljava/lang/ClassLoader;' (L2): Lookup failed for klass sun.security.util.SecurityConstants: not initialized
      [0.103s][warning][scc] 974 'java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(Ljava/lang/Class;Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/invoke/MemberName;' (L2): Lookup failed for holder java.lang.invoke.ConstantCallSite: not linked
      [0.103s][warning][scc] 2473 'java.lang.invoke.CallSite.makeSite(Ljava/lang/invoke/MethodHandle;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/invoke/CallSite;' (L2): Lookup failed for holder java.lang.invoke.ConstantCallSite: not linked
      [0.106s][warning][scc] 607 (L2): Lookup failed for class [Ljava/util/regex/IntHashSet;
      [0.106s][warning][scc] 638 'java.lang.invoke.MethodHandles$Lookup.revealDirect(Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandleInfo;' (L2): Lookup failed for klass java.lang.invoke.InfoFromMemberName: not initialized
      [0.110s][warning][scc] 1269 'java.lang.invoke.AbstractValidatingLambdaMetafactory.<init>(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/invoke/MethodType;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;Z[Ljava/lang/Class;[Ljava/lang/invoke/MethodType;)V' (L2): Lookup failed for holder java.lang.invoke.InfoFromMemberName: not linked
      [0.110s][warning][scc] 1332 'java.lang.invoke.LambdaProxyClassArchive.loadedByBuiltinLoader(Ljava/lang/Class;)Z' (L2): Lookup failed for klass sun.security.util.SecurityConstants: not initialized
      [0.111s][warning][scc] 1494 'sun.util.locale.LocaleObjectCache.get(Ljava/lang/Object;)Ljava/lang/Object;' (L2): Lookup failed for klass sun.util.locale.LocaleObjectCache$CacheEntry: not initialized
      [0.115s][warning][scc] 2474 'java.lang.invoke.CallSite.<init>(Ljava/lang/invoke/MethodHandle;)V' (L2): Lookup failed for holder java.lang.invoke.MethodHandleNatives$CallSiteContext: not linked
      [35.920s][info ][init] SharedRuntime:
      [35.920s][info ][init] resolve_opt_virtual_call: 3ms / 593 events
      [35.920s][info ][init] resolve_virtual_call: 1ms / 201 events
      [35.920s][info ][init] resolve_static_call: 1ms / 335 events
      [35.920s][info ][init] handle_wrong_method: 33804ms / 23026912 events
      [35.920s][info ][init] ic_miss: 0ms / 79 events
      [35.920s][info ][init] Total: 33812ms
      [35.920s][info ][init] ClassLoader:
      [35.920s][info ][init] clinit: 18ms / 540 events
      [35.920s][info ][init] resolve...
      [35.920s][info ][init] invokedynamic: 0ms / 1 events
      [35.920s][info ][init] invokehandle: 0ms / 28 events
      [35.920s][info ][init] CP_MethodHandle: 0ms / 2 events
      [35.920s][info ][init] CP_MethodType: 0ms / 2 events
      [35.920s][info ][init] ClassPrelinker:
      [35.920s][info ][init] preload: 11ms / 2819 events
      ^C

            kvn Vladimir Kozlov
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: