Generate java dump when OutOfMemory

前端 未结 3 1150
难免孤独
难免孤独 2021-01-05 05:34

I have a program that should eventually generate OutOfMemory . The program code is:

public class VeryLargeObject implements Serializable {
    p         


        
3条回答
  •  被撕碎了的回忆
    2021-01-05 06:04

    I suspect the jvm could not write to the path and fails silently. For example, this has to be a file name in a directory which exists. If you have a directory D:\workspace it will fail. If you have D:\workspace\heap.hprof it may work. Try creating a blank file of that name first to see you can do this.

提交回复
热议问题