How to debug a native Java crash on Linux?

后端 未结 3 611
猫巷女王i
猫巷女王i 2021-02-13 05:49

I\'ve seen this question and this article on how to debug a native Java crash. The article is with respect to Windows. What are the equivalent debugging aids on Linux?

相关标签:
3条回答
  • 2021-02-13 06:25

    Do you really need -Xmx2000000k? Looks like you are only using about 84MB of that.

    My experience is that you really can't reliably go above about 1700MB heap in a 32 bit process space anyway. So, that setting may be causing this problem.

    0 讨论(0)
  • 2021-02-13 06:27

    I was expecting a JNI call in the crash dump, but it does not appear to be the cause, but instead a bug in the pthreads library.

    I cannot remember offhand if the pthreads library must be provided by the underlying platform or it is baked into the JRE, but I would suggest that you ensure that you are running on one of the officially supported Linux platforms and if not, then strongly consider switching.

    0 讨论(0)
  • 2021-02-13 06:44

    Unless your JNI library has corrupted a random area of memory (which is extreamly difficult to debug), the most likely cause of a crash in the libjvm is a bug in the JVM. Given the current release is Java 6 update 23 and you have Java 6 update 3, upgrading is the first thing I would try.

    BTW: Also you appear to have a 64-bit OS, you might like to try the 64-bit Java.

    BTW2: You can write -Xmx2000000k as -mx2g. The default maximum on a 8 GB machine should be about 2 GB anyway.

    0 讨论(0)
提交回复
热议问题