Hello,
first of all, sorry about my english. I hope someone could know if there is any problem with my code or it's a problem with poi library. I'm using poi 3.9.
The fact is this:
1.- I read a file with XWPFDocument:
2.- I do some operations, but I've tried the code withour any code here, so I'll pass.
3.- I write the file into disk:
The size of the document get's changed, but this doesn't worry me. The problem is that after several modifications, the size of it are increased each time. At about 14 or 15 "open-close" iterations, the file stucks in this line:
It takes 100% cpu and 100% of available Java memory, until out of memory error is thrown. I think poi modifies the internal structure adding some things to it. If I open the file with Word, and save it, it turns to the beginning state, all ok, but I need to get it modified automatically a lot of times.
Anyone has faced something similar?
first of all, sorry about my english. I hope someone could know if there is any problem with my code or it's a problem with poi library. I'm using poi 3.9.
The fact is this:
1.- I read a file with XWPFDocument:
Code:
File docFile = null;
docFile = new File(fileUrl);
FileInputStream fis;
try {
fis = new FileInputStream(docFile.getAbsolutePath());
XWPFDocument doc = new XWPFDocument(fis);
3.- I write the file into disk:
Code:
FileOutputStream out = new FileOutputStream(outFile);
doc.write(out);
out.close();
Code:
XWPFDocument doc = new XWPFDocument(fis);
Anyone has faced something similar?