MBP Apple 芯片在 debug 时会卡好久怎么办?

2023-03-25 18:53:47 +08:00
 keno

问题:

首次 debug时访问数据库、redis 等(看起来是所有网络请求)都会卡几分钟左右,之后再次进入 debug 就不会卡。在没有 debug 场景下也不会卡。

之前在 M1 上也出现过这种现象,现在在 M2 上更明显了,在烧烤架 Intel 上没出现此现象。

在网上搜了一圈,试了各种方法也没解决。。。不知道各位有没有遇到过类似情况,如何解决。

简单分析:

应该是 OpenJdk8-aarch64 的问题,M2 上也试过使用 Oracle jdk-8u351 x64 debug 时不会卡,但是编译要比 Zulu aarch64 jdk 慢得多。。。

贴一下配置:

1381 次点击
所在节点    macOS
10 条回复
lamls
2023-03-25 20:26:13 +08:00
intel 的 u 没有此问题啊
keno
2023-03-25 22:52:50 +08:00
@lamls 是的
yiqiu2324
2023-03-26 09:44:25 +08:00
尝试下 oracle jdk 17 的 arm 版本,看看行不行
yiqiu2324
2023-03-26 09:49:34 +08:00
SN1997
2023-03-26 11:43:28 +08:00
有解决办法了没 我用的 zulu jdk8 也是这个问题
keno
2023-03-26 20:36:57 +08:00
@yiqiu2324 高版本没试过,应该是没问题的,主要是项目用的 JDK8 ,没办法提版本。。。
Gav1nw
2023-03-26 21:28:24 +08:00
试试 JDK11
653513754
2023-03-26 23:43:08 +08:00
所以你 debug 的啥呀,语言平台 IDE 什么都不说
keno
2023-04-01 17:36:03 +08:00
已经反馈给 Azul 官方,官方已确定这是个 issue ,何时修复未知。另建议考虑付费版本可以快速修复。说白话就是:“免费,等;加钱,行”
原话:
The issue is now under investigation. Based on the OpenJDK and Zulu release cycles, if the issue is fixed, it will be included in the next quarterly release. This is the fastest way to get a bug fixed in the community version. If you are interested in our off the cycle fixes and fast response to these kind of bugs, please refer to the Zulu Core versions, which is a paid subscription version: https://www.azul.com/products/pricing/.
keno
2023-04-25 18:23:29 +08:00
一个月了,Azul 官方给最终结论了,不会给非订阅用户修复这个 issue 。
但给出了一个解决方案,在 IDEA 项目里设置 SDK 为 Zulu 17 ,Language Level 设置为 8 。
实测 debug 不卡了,但是伴随来的是其他版本问题。
不得已而求其次,将就用吧。。。。。。

附解决方案链接(需注册登录): https://support.azul.com/hc/en-us/articles/14875656063508-Faster-debugging-of-Java-8-applications-on-macOS-M1-M2-CPUs



@SN1997

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/927151

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX