问题描述
我正在尝试使用JProfiler来分析使用lambdas的Java应用程序。我无法识别,探查器显示哪个lambda作为热点:
我很感激任何有关理解涉及lambdas的堆栈跟踪格式的帮助,例如edu.indiana.soci.spidal.vectorclass.lambda $ PairwiseThread_SecDrv $ 23
谢谢!
不幸的是,没有直接的方法来识别lambda,因为lambdas本质上没有名字。在运行时,lambdas目前使用匿名类实现。它们在包含类的$符号后按顺序编号。
如果在JProfiler中打开行号解析(会话设置 - >性能分析设置选项卡 - >自定义 - >方法调用记录选项卡上的复选框),您将在热点回溯中的运行方法中看到一个行号,如果它是该行上唯一的lambda,它将帮助您找到lambda。 / p>
I am trying to profile a Java application that uses lambdas using JProfiler. I am having trouble identifying, which lambda the profiler is showing as a hotspot:
I would appreciate any help on understanding the format of the stack trace involving lambdas like "edu.indiana.soci.spidal.vectorclass.lambda$PairwiseThread_SecDrv$23"
Thank you!
Unfortunately, there is no direct way to identify the lambda because lambdas by nature have no name. At runtime, lambdas are currently implemented with anonymous classes. They are numbered sequentially after the $ sign with respect to the containing class.
If you turn on line number resolution in JProfiler (session settings-> profiling settings tab-> customize-> check box on the "method call recording" tab), you will see a line number on the "run" method in the hot spot back trace which should help you to find the lambda if it's the only lambda on that line.
这篇关于在Java 8中识别stacktrace中的lambdas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!