search

Home  >  Q&A  >  body text

jvm - 使Java虚拟机崩溃的程序

我比较好奇这个问题,尽管我知道JVM现在已经非常稳定,但还是止不住这样问:

ringa_leeringa_lee2846 days ago762

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-04-17 11:20:04

    The poster can take a look at this: http://stackoverflow.com/questions/65200/how-do-you-crash-a-jvm

    reply
    0
  • PHPz

    PHPz2017-04-17 11:20:04

    You need to explain what you mean by "crash": does it mean running out of resources of the machine, triggering an exception that is not allowed by the system, triggering a design error in the JVM, or something else. The concept of "collapse" is still very broad. ——When resources are exhausted, no matter what language there is, there is a universal solution: calling several empty functions in a loop, causing the system's recursive stack to explode, which is called stack overflow. To trigger an exception that is not allowed by the system, just access the memory that is not within the application of your own program, which is a segmentation fault. But I believe that these two answers are probably not what you are expecting.

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 11:20:04

    http://rednaxelafx.iteye.com/blog/460893
    http://rednaxelafx.iteye.com/blog/461787
    Let me take a look at these two. Although the title is <If you want to make the CLR hang up...>, it also comes down to the JVM.

    reply
    0
  • Cancelreply