I am trying to open a workbook in an XLSX format in order to parse it and retrieve certain elements from certain cells. The file is provided by a customer. Please find (a modified version of) the file attached. I am able to open the file directly in Excel, but not in POI. I'm running Java version jdk1.6.0_23 and have installed version 3.10 of the POI library package. When attempting to parse the file using "org.apache.poi.xssf.usermodel.XSSFWorkbook", Memory usage jumps from under 200KB to over 1.1GB. The CPU also jumps to 100% capacity. The program then stalls and does not recover. The Debug window in Eclipse shows a large number (380) of Threads as "Running". I would really appreciate it if you could investigate the cause behind this issue. Thanks in advance, Eamonn. P.s. I looked at bug 55769, but we do not get any error message - Java just hangs...
Can you try bumping up the heap size more, to see if that helps? Can you run the jvm so it reports when it does garbage collection, so you can see if the hang is due to terminal-GC or something else? If you take a thread dump, what are the threads doing when it hangs?
(In reply to Nick Burch from comment #1) > Can you try bumping up the heap size more, to see if that helps? > > Can you run the jvm so it reports when it does garbage collection, so you > can see if the hang is due to terminal-GC or something else? > > If you take a thread dump, what are the threads doing when it hangs? Nick, Thanks a million for your swift response. We increased the heap size and that allows us to process the file. So thanks for the suggestion. It is slow, but it gets there. Thanks again, Eamonn.
OK, that's good. Next thing to check - is the problem with your code or file? There's two example programs that can be used to check generation speed and reading speed, try using SSPerformanceTest to check how long to generate a simple file of your desired size. Next check if your program can load it quicker or not. Now, use XLSX2CSV to read both your file and your generated test file - how slow/quick, and are they about the same speed?
Hi, We encountered the same behavior, 25 MB file with 382K rows and 15 columns each. anything lower than that and we get OOM exception. We are using POI-3.10-FINAL on JDK 7 with the latest patch. Please advise. Thank you, Arik
Have you tried following the suggestions/strategy from the FAQ entry "I think POI is using too much memory! What can I do?" ? http://poi.apache.org/faq.html#faq-N10109
There was no feedback over the last 5 month, so I'm closing this now. We can re-open it later anyways ...