【发布时间】:2018-09-05 13:45:11
【问题描述】:
我在 Java 8 / Spring 5 / Tomcat 8.5 Web 应用程序中观察到超长时间运行的请求(>30 秒)。大多数请求都能正常响应。 值得注意的是,在正常运行几天后,长跑者的频率增加了。
线程转储显示 Unsafe.defineClass 挂起:
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393)
at sun.reflect.MethodAccessorGenerator.generateMethod(MethodAccessorGenerator.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:53)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.core.annotation.AnnotationUtils.getValue(AnnotationUtils.java:1328)
at org.springframework.core.annotation.AnnotatedElementUtils$MergedAnnotationAttributesProcessor.getAdaptedValue(AnnotatedElementUtils.java:1627)
at org.springframework.core.annotation.AnnotatedElementUtils$MergedAnnotationAttributesProcessor.overrideAttributes(AnnotatedElementUtils.java:1610)
at org.springframework.core.annotation.AnnotatedElementUtils$MergedAnnotationAttributesProcessor.postProcess(AnnotatedElementUtils.java:1598)
at org.springframework.core.annotation.AnnotatedElementUtils$MergedAnnotationAttributesProcessor.postProcess(AnnotatedElementUtils.java:1515)
at org.springframework.core.annotation.AnnotatedElementUtils.searchWithFindSemantics(AnnotatedElementUtils.java:1145)
at org.springframework.core.annotation.AnnotatedElementUtils.searchWithFindSemantics(AnnotatedElementUtils.java:1066)
at org.springframework.core.annotation.AnnotatedElementUtils.searchWithFindSemantics(AnnotatedElementUtils.java:1038)
at org.springframework.core.annotation.AnnotatedElementUtils.findMergedAnnotationAttributes(AnnotatedElementUtils.java:650)
at org.springframework.core.annotation.AnnotatedElementUtils.findMergedAnnotation(AnnotatedElementUtils.java:726)
....
有人见过这个问题吗?
【问题讨论】:
-
为我的 jstack 问题创建了一个单独的问题:stackoverflow.com/questions/49516601/…
标签: java spring-mvc tomcat8