Bug 64860

Summary: Split large document multiple small document
Product: POI Reporter: Dilipkumar <dkaruppan>
Component: XWPFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: blocker    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: WHile converting large docx file into sfdt format throwing error

Description Dilipkumar 2020-10-29 12:29:11 UTC
Created attachment 37539 [details]
WHile converting large docx  file into sfdt format throwing error

HI I am converting docx into sfdt fromat it is worked for fine with 150 document having 200 pages if documents  large file which contains 2500 pages (8 mb) file means it giving error out of memory error.Can any one help how to resolve this error or suggest me solution to split large document into  multiple small documents.I have attached error also kindly check and make quick response on that.

this is the exact code i am using.

@PostMapping("/wordeditor/Import")
	public String uploadFile(@RequestParam("files") MultipartFile file) throws Exception {
		try {
			return WordProcessorHelper.load(file.getInputStream(), FormatType.Docx);
		} catch (Exception e) {
			e.printStackTrace();
			return "{\"sections\":[{\"blocks\":[{\"inlines\":[{\"text\":" + e.getMessage() + "}]}]}]}";
		}
	}
Comment 1 PJ Fanning 2020-10-29 12:33:47 UTC
Apologies Dilip - this is a bug tracker and this is not a bug.

I would suggest you use stackoverflow or possibly the POI user email list.
Comment 2 PJ Fanning 2020-10-29 14:20:33 UTC
Have you tried increasing the heap size on your JVM? (-Xmx)
Comment 3 PJ Fanning 2020-10-29 14:22:40 UTC
Maybe also worth reading articles like https://stackoverflow.com/questions/45740269/parsing-large-docx-file-in-java