V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
keno
V2EX  ›  macOS

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

  •  2
     
  •   keno · 2023-03-25 18:53:47 +08:00 · 1321 次点击
    这是一个创建于 368 天前的主题,其中的信息可能已经有所发展或是发生改变。

    问题:

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

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

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

    简单分析:

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

    贴一下配置:

    • 机器:

      2023 MacBook Pro 14' macOS 13.2.1

    • JDK:

      openjdk version "1.8.0_362"

      OpenJDK Runtime Environment (Zulu 8.68.0.21-CA-macos-aarch64) (build 1.8.0_362-b09)

      OpenJDK 64-Bit Server VM (Zulu 8.68.0.21-CA-macos-aarch64) (build 25.362-b09, mixed mode)

    第 1 条附言  ·  2023-03-27 09:16:55 +08:00
    • IDE:

    IntelliJ IDEA 2021.2.2 aarch64

    10 条回复    2023-04-25 18:23:29 +08:00
    lamls
        1
    lamls  
       2023-03-25 20:26:13 +08:00
    intel 的 u 没有此问题啊
    keno
        2
    keno  
    OP
       2023-03-25 22:52:50 +08:00 via Android
    @lamls 是的
    yiqiu2324
        3
    yiqiu2324  
       2023-03-26 09:44:25 +08:00 via iPhone
    尝试下 oracle jdk 17 的 arm 版本,看看行不行
    yiqiu2324
        4
    yiqiu2324  
       2023-03-26 09:49:34 +08:00 via iPhone
    SN1997
        5
    SN1997  
       2023-03-26 11:43:28 +08:00 via iPhone
    有解决办法了没 我用的 zulu jdk8 也是这个问题
    keno
        6
    keno  
    OP
       2023-03-26 20:36:57 +08:00
    @yiqiu2324 高版本没试过,应该是没问题的,主要是项目用的 JDK8 ,没办法提版本。。。
    Gav1nw
        7
    Gav1nw  
       2023-03-26 21:28:24 +08:00
    试试 JDK11
    653513754
        8
    653513754  
       2023-03-26 23:43:08 +08:00
    所以你 debug 的啥呀,语言平台 IDE 什么都不说
    keno
        9
    keno  
    OP
       362 天前
    已经反馈给 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
        10
    keno  
    OP
       337 天前
    一个月了,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
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4165 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 10:15 · PVG 18:15 · LAX 03:15 · JFK 06:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.