Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
Yourkit 非常好,但我想说的是,分析器通常对于示例亚毫秒延迟应用程序不是很有用。
但是,如果您还没有查看内存使用情况,那么我将从这里开始。您如何确保最小化;对象创建、缓存未命中、上下文切换开销(来自在线程之间传递数据)?你的所有代码都预热了吗?即这样您就不会遇到任何交互代码。
我建议您使用 nanoTime() 为应用程序中的关键执行路径添加时间戳,以记录关键阶段每个请求的时间,以了解您在哪里遇到了最大的延迟。
顺便说一句:Java 应用程序的响应时间可以低于 100 微秒。
BTW2:可以减少白天的Full GC次数,只在晚上进行系统Full GC。通过增加 eden 大小,您可能会达到没有小型集合的程度。
Yourkit is very good, except I would say that profilers in general are not very useful for exampling sub-millisecond latency applications.
However, if you haven't looked at your memory usage, then this where I would start. How are you ensuring you minimise; object creation, cache misses, context switching overhead (from passing data between threads)? Is all your code warmed up? i.e. so you are not hitting any interperated code.
I suggest you timestamp with nanoTime() the key execution path in you application to record the timing of each request at key stages to see where you are experiencing the most delay.
BTW: It is possible to get a Java application with sub 100 micro-seconds response time.
BTW2: It is possible to reduce the number of Full GCs during the day and have the system Full GC only at night. By increasing the eden size you might get to the point where you have no minor collections either.
我已经习惯了使用 yourkit 分析器:
http://www.yourkit.com/
你的里程可能会有所不同,但我喜欢它,它值得一试看。过去我用它来识别和避免锁争用,并且我知道它有能力识别代码的热门部分(我希望任何分析器都可以)
I've gotten comfortable using the yourkit profiler:
http://www.yourkit.com/
Your mileage may vary, but I like it, its worth a look. In the past I have used it to identify and avoid lock contention, and I know it has capability to identify the hot sections of your code (as would any profiler, I expect)
查看 NetBeans Profiler。建议它,因为没有人提出同样的建议。这个看起来功能更丰富。
我曾多次使用过另一个工具"JProfiler"。但它只是免费试用。
Checkout NetBeans Profiler. Suggesting it as no one else has suggested same. This one looks more feature rich.
I have used another tool "JProfiler" few times. But its only free for trial.