jvm - 使Java虚拟机崩溃的程序
ringa_lee
ringa_lee 2017-04-17 11:18:04
0
3
731

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

  • 首先,仅仅使用Java,如何编写一个程序使Java虚拟机崩溃?
  • 其次,如果用其他任何运行在JVM上的语言,比如JRubyClojure等,如何编写一个程序使JVM崩溃?

    至于提到的JVM,可以是任何平台上的,比如Windows、Linux或任何UNIX。

ringa_lee
ringa_lee

ringa_lee

reply all(3)
小葫芦

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

PHPzhong

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.

小葫芦

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template