eclipse安装MAT出现An internal error occurred during: "Parsing heap dump from‘**\java_pid6564.hprof '

1、在eclipse中一次点击Help -> install new sorftware 然后输入http://download.eclipse.org/mat/1.7/update-site/进行安装;
2、使用下面代码生成文件java_pid6564.hprof后,打开java_pid6564.hprof,报错“Parsing heap dump from‘**\java_pid6564.hprof”:

/**
 * Vm args:-Xms20M -Xms20M -XX:+HeapDumpOnOutOfMemoryError
 * java 堆内存溢出测试,深入理解java虚拟机 p51
 * @author Rail
 *
 */
public class HeapOutOfMemoryError {

    static class OutOfMemoryError{

    }
    public static void main(String[] args) {
        List list = new ArrayList();
        while(true){
            list.add(new OutOfMemoryError());
        }
    }

}

3、解决方法:找到eclipse.ini,将-Xmx256m修改到-Xmx2048m即可
来源:Stack Overflow

你可能感兴趣的:(jvm)