Re: out of memory error when creating pptx file

2020-02-03 Thread Andreas Beeker
Hi, XSLF and XmlBeans are undoubtedly memory hogs, but I can't solve this in a short period - I often thought about an internal model which we could use for XSLF / HSLF but lets get back to your issue. So when you say, you need to generate 600 slides ... does that mean they have similar

Debugging tip for "Excel cannot open the file" ... when opening the file created by POI OOXML

2020-02-03 Thread Kuro Kurosaka
Hi, I created an .xlsx file using Apache POI XML (using XSSFWorkbook class). The .xlsx file created by a unit test could be opened from Excel but when I tried to open the .xlsx file from a real run, Excel won't open it with an error message like this in its pop up: Excel cannot open the file

Re: Debugging tip for "Excel cannot open the file" ... when opening the file created by POI OOXML

2020-02-03 Thread Andreas Beeker
Hi, I'd do the same in the unit test as in the real run. Unzip and compare both files. What's the difference? What is a real run like? is this a web application? Do you have duplicated POI jars in the classpath? Andi On 03.02.20 20:55, Kuro Kurosaka wrote: > Hi, > I created an .xlsx file using

out of memory error when creating pptx file

2020-02-03 Thread jaehoon jeong
Hello I'm trying to generate a pptx file using the poi library. The XMLSlideShow class contains about 600 XSLFSlides. Each XSLFSlide object uses about 3mb of memory. 1.8gb of memory is required to create one pptx file. It uses out too much memory, causing an out of memory error. And I can't

Re: out of memory error when creating pptx file

2020-02-03 Thread Rob Sargent
Since no one really wants to sit through 600 slides, break the total up in “chapters” and see where that gets you? How much memory does you machine have, which version of java are you using. > On Feb 3, 2020, at 7:15 AM, jaehoon jeong wrote: > > Hello > > I'm trying to generate a pptx file

Re: Debugging tip for "Excel cannot open the file" ... when opening the file created by POI OOXML

2020-02-03 Thread Andreas Beeker
Please open a new bugzilla entry if you find something - of course you can reference #59738 in the text. If POI 3.10.1 is fine for you and you don't use POI to parse arbitrary files, then go for it. Since POI 3.10.1 there were some CVEs - so depending on your usecase, it might be safer to use a

Re: Debugging tip for "Excel cannot open the file" ... when opening the file created by POI OOXML

2020-02-03 Thread Kuro Kurosaka
I've read this issue https://bz.apache.org/bugzilla/show_bug.cgi?id=59738 which suggests version 3.10.1 works. And I tried this version and the problem is gone! Should I re-open this issue, if I can find a way to reproduce it? On Mon, Feb 3, 2020 at 1:39 PM Kuro Kurosaka wrote: > OLE2 is a

Re: Debugging tip for "Excel cannot open the file" ... when opening the file created by POI OOXML

2020-02-03 Thread Jörn Franke
Can you share the code of the unit test? Maybe the file is not properly closed on the application server or there is an unlogged exception. > Am 03.02.2020 um 23:41 schrieb Kuro Kurosaka : > > I've read this issue > https://bz.apache.org/bugzilla/show_bug.cgi?id=59738 > which suggests version

Re: Debugging tip for "Excel cannot open the file" ... when opening the file created by POI OOXML

2020-02-03 Thread Kuro Kurosaka
Andi, Thank you for the quick reply. The .xlsx file from the test run has the same file structure as the .xlsx from the real run that doesn't open. The JAR I upload to an application server is shaded and includes the POI library that is relocated to its version specific packages to avoid

Re: Debugging tip for "Excel cannot open the file" ... when opening the file created by POI OOXML

2020-02-03 Thread Andreas Beeker
We have two entries in the FAQ [1] about file validation, which I haven't used myself yet ... and probably are futile in your case. You can try to validate against the ECMA 376 schemes. If I have similar problems I try to go step-wise from the simple case to the complex ... and yes, it's

Re: Debugging tip for "Excel cannot open the file" ... when opening the file created by POI OOXML

2020-02-03 Thread Kuro Kurosaka
OLE2 is a Windows file format, isn't it? I'm on Mac/Linux, and even if the validator exists and runs for .xlsx, I can't run it. (I'm assuming it's an .exe file.) The link to the article is broken also. I'll try to find if there's any code closer to validator in POI source. Thank you for

Re: Debugging tip for "Excel cannot open the file" ... when opening the file created by POI OOXML

2020-02-03 Thread Kuro Kurosaka
I thought I created a test case by calling the APIs exactly as it does on the app server, but it didn't quite work. The generated .xlsx file opens successfully even when I used POI 3.17. I will create a new issue if I find a way to reproduce this consistently. I have been calling

Re: out of memory error when creating pptx file

2020-02-03 Thread Rob Sargent
On 2/3/20 7:20 PM, jaehoon jeong wrote: Thank you for your reply. I am using oracle jdk1.8. But I do not want to increase heap memory. I want to find a solution in another way. How little memory must this fit in? What does "chpaters" you mean? For example, does it mean to divide into 100

Re: out of memory error when creating pptx file

2020-02-03 Thread jaehoon jeong
Thank you for your reply. I am using oracle jdk1.8. But I do not want to increase heap memory. I want to find a solution in another way. What does "chpaters" you mean? For example, does it mean to divide into 100 slides and save each file? I do not want to save as multiple files. I want to save