poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56006] New: XWPFDocument increasing size and gets unusable after several "read-write" iterations
Date Tue, 14 Jan 2014 16:49:22 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=56006

            Bug ID: 56006
           Summary: XWPFDocument increasing size and gets unusable after
                    several "read-write" iterations
           Product: POI
           Version: 3.9
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: XWPF
          Assignee: dev@poi.apache.org
          Reporter: andresfr84@gmail.com

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:

     File docFile = null;
                     docFile = new File(fileUrl);
                     FileInputStream fis;
                        try {
                                fis = new
FileInputStream(docFile.getAbsolutePath());
                                XWPFDocument doc = new XWPFDocument(fis);

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:

       FileOutputStream out = new FileOutputStream(outFile);
                                 doc.write(out);
                                 out.close();

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:

      XWPFDocument doc = new XWPFDocument(fis);

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message