问题遇到的现象和发生背景
遇到的现象和发生背景,请写出第一个错误信息
poi 读取Word文件
问题相关代码,请勿粘贴截图
String path1 = "aaa.docx";
FileInputStream fileInputStream = new FileInputStream(path1);
XWPFDocument wordDocument = new XWPFDocument(fileInputStream);//此处内存溢出
运行结果及报错内容
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument$Factory.parse(Unknown Source)
at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:180)
at org.apache.poi.ooxml.POIXMLDocument.load(POIXMLDocument.java:184)
at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:145)
at com.work.controller.新时代英汉.ReadWord.main(ReadWord.java:31)