Hi dev Team,

I am using apche POI-3.10, I have to read an sample.docx file and write its 
content to new sampleOutput.docx file.
However I have succeed to do the same but while reading file's more than or 
equal to 10mb in size, XWPFDocument is not able to read the file, its throwing 
error "java.lang.OutOfMemoryError: Java heap space"

Following is the sample code for the reference, Request you to help me with any 
solution

try {
FileInputStream  fis = new FileInputStream("sample.docx");
                XWPFDocument  document = new 
XWPFDocument(OPCPackage.open(inputFilePath));  // its throws error here with 
files of size >= 10 mb
                OutputStream  outStream = new FileOutputStream(outputFilePath);

                document. write(outStream);

}catch(Exception e){
                e.printStackTrace();
}



Request your help to assist me regarding the same, would be waiting for the 
guidance from you as what next to do.


Thanks and Regards,
________________________________
| Ajeet Singh |  Mastek Ltd | Mobile: +91 8652467708 |MNDC - Mahape
________________________________

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of 
Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
does not accept any responsibility or liability for it. This e-mail and 
attachments (if any) transmitted with it are confidential and/or privileged and 
solely for the use of the intended person or entity to which it is addressed. 
Any review, re-transmission, dissemination or other use of or taking of any 
action in reliance upon this information by persons or entities other than the 
intended recipient is prohibited. This e-mail and its attachments have been 
scanned for the presence of computer viruses. It is the responsibility of the 
recipient to run the virus check on e-mails and attachments before opening 
them. If you have received this e-mail in error, kindly delete this e-mail from 
desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to