您的位置:首页 > 教育 > 锐评 > finalshell 4.5.x在m1mac闪退

finalshell 4.5.x在m1mac闪退

2025/2/23 21:26:08 来源:https://blog.csdn.net/lswandt/article/details/141965693  浏览:    关键词:finalshell 4.5.x在m1mac闪退

使用过程中会出现突然闪退,尤其在定位生产打开一堆窗口的情况下,绝绝子

闪退崩溃日志:

Thread 116 Crashed:: Java: pool-4-thread-28
0   libsystem_kernel.dylib        	       0x18e926600 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x18e95ef70 pthread_kill + 288
2   libsystem_c.dylib             	       0x18e86b908 abort + 128
3   libjvm.dylib                  	       0x1078e0140 os::abort(bool, void*, void const*) + 56
4   libjvm.dylib                  	       0x107aa6ef8 VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long) + 2404
5   libjvm.dylib                  	       0x107aa6588 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*, char const*, ...) + 72
6   libjvm.dylib                  	       0x107aa72a8 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*) + 36
7   libsystem_platform.dylib      	       0x18e994184 _sigtramp + 56
8   libjvm.dylib                  	       0x107460ca0 BlockLocationPrinter<G1CollectedHeap>::base_oop_or_null(void*) + 236
9   libjvm.dylib                  	       0x107460ca0 BlockLocationPrinter<G1CollectedHeap>::base_oop_or_null(void*) + 236
10  libjvm.dylib                  	       0x10745e334 BlockLocationPrinter<G1CollectedHeap>::print_location(outputStream*, void*) + 64
11  libjvm.dylib                  	       0x1078d4914 os::print_location(outputStream*, long, bool) + 220
12  libjvm.dylib                  	       0x1078db71c os::print_register_info(outputStream*, void const*, int&) + 180
13  libjvm.dylib                  	       0x107aa56d0 VMError::report(outputStream*, bool) + 10472
14  libjvm.dylib                  	       0x107aa6a14 VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long) + 1152
15  libjvm.dylib                  	       0x107aa6588 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*, char const*, ...) + 72
16  libjvm.dylib                  	       0x107aa72a8 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*) + 36
17  libsystem_platform.dylib      	       0x18e994184 _sigtramp + 56
18  libjvm.dylib                  	       0x107460ca0 BlockLocationPrinter<G1CollectedHeap>::base_oop_or_null(void*) + 236
19  libjvm.dylib                  	       0x107460ca0 BlockLocationPrinter<G1CollectedHeap>::base_oop_or_null(void*) + 236
20  libjvm.dylib                  	       0x10745e334 BlockLocationPrinter<G1CollectedHeap>::print_location(outputStream*, void*) + 64
21  libjvm.dylib                  	       0x1078d4914 os::print_location(outputStream*, long, bool) + 220
22  libjvm.dylib                  	       0x1078db71c os::print_register_info(outputStream*, void const*, int&) + 180
23  libjvm.dylib                  	       0x107aa40e8 VMError::report(outputStream*, bool) + 4864
24  libjvm.dylib                  	       0x107aa6a14 VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long) + 1152
25  libjvm.dylib                  	       0x107aa6588 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*, char const*, ...) + 72
26  libjvm.dylib                  	       0x107aa72a8 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*) + 36
27  libjvm.dylib                  	       0x10797dc84 JVM_handle_bsd_signal + 424
28  libsystem_platform.dylib      	       0x18e994184 _sigtramp + 56
29  libjvm.dylib                  	       0x1075de84c jni_SetByteArrayRegion + 428
30  ???                           	       0x113d39e10 ???
31  ???                           	       0x1142ad018 ???
32  ???                           	      0x2e000409b0 ???

以下为gpt分析的结果
在这里插入图片描述
查看原始finalshell中配置的启动参数,投喂gpt给出了一些解决方案

在这里插入图片描述

当前配置选项解释

  1. -Djpackage.app-version=4.5.2

    • 设置应用程序的版本号为 4.5.2。
    • 优化建议:这个选项无须更改,因为它只是设置版本信息。
  2. -Dsun.java2d.opengl=true

    • 启用 OpenGL 硬件加速。
    • 优化建议:如果你的应用程序不依赖 OpenGL 硬件加速,或者 OpenGL 可能导致不稳定,可以尝试禁用此选项以排除它作为潜在问题的可能性。
  3. -XX:MinHeapFreeRatio=10

    • 设置 JVM 最小空闲堆内存比例为 10%。
    • 优化建议:这个值比较低,可以尝试增加这个值,例如 20%,以确保 JVM 有足够的空闲内存进行垃圾回收。
  4. -XX:MaxHeapFreeRatio=30

    • 设置 JVM 最大空闲堆内存比例为 30%。
    • 优化建议:这个值也比较低,可以尝试增加这个值,例如 40%,以确保 JVM 有足够的空闲内存进行垃圾回收。
  5. --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED

    • 允许未命名模块访问 java.desktop 模块中的 com.apple.eawt 包。
    • 优化建议:如果你的应用程序需要访问 com.apple.eawt 包,这个选项是必要的,无须更改。

其他优化建议

  1. 增加堆栈大小

    • 如果你的应用程序可能因为堆栈溢出而崩溃,可以增加 JVM 堆栈大小,例如:
      -Xss2m
      
    • 默认堆栈大小通常是 1MB,你可以尝试增加到 2MB 或更大。
  2. 启用详细的垃圾收集日志

    • 以便更好地监控垃圾收集情况和内存使用情况:
      -Xlog:gc*:file=gc.log:time,uptime:filecount=5,filesize=10m
      
  3. 启用崩溃日志

    • 以便在 JVM 崩溃时生成更多的调试信息:
      -XX:+CreateCoredumpOnCrash
      -XX:+HeapDumpOnOutOfMemoryError
      -XX:HeapDumpPath=/path/to/dump
      
  4. 增加初始堆内存和最大堆内存

    • 例如:
      -Xms512m
      -Xmx2g
      

最终优化后的内容,目前使用中暂时未遇到闪退
文件路径 /Applications/FinalShell.app/Contents/app/FinalShell.cfg

[Application]
app.classpath=$APPDIR/finalshell.jar
app.mainclass=st
app.classpath=$APPDIR/lib-run/bcprov.jar[JavaOptions]
java-options=-Djpackage.app-version=4.5.2
java-options=-Dsun.java2d.opengl=true
java-options=-XX:MinHeapFreeRatio=20
java-options=-XX:MaxHeapFreeRatio=40
java-options=--add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED
java-options=-Xss2m
java-options=-Xms512m
java-options=-Xmx2g

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com