Hi Jim, Thanks for your answer, I did that but how do you refresh the pivot table? When you build a pivotTable you need to specify the AreaReference, and at the beginning the AreaReference of my pivot table is only the first two rows, how can i change it to be for all the rows that I made with SXSSF and also I think that's the reason of the memory increase. Is not SXSSF or XSSF, the main reason of the amount usage of memory is that the AreaReference for the pivot Table is huge. Am I right? What do you think?
On Sat, Mar 21, 2015 at 3:59 AM, Jim Talbut <[email protected]> wrote: > Hi Carlos, > > One technique that might help for you is to separate the pivot table work > from the output of the data. > Create the pivot table up front (ideally using Excel, but with POI if you > have to) using an input sheet that has the structure of your final data but > that only contains two rows (header row plus one data row). > Then, as a completely separate pass, replace all the cells in the input > sheet with your real data using SXXF. > > Jim > > > On 20/03/2015 15:40, Carlos Arroyo wrote: > >> My files aren't too heavy, they're like 2MB, but they have like 2000 rows >> and 95 columns. I found the memory values for XSSF: about 630 bytes/cell >> and maybe that's why my files consume a lot of memory and I get "Java out >> of memory error". Could you please help me or give me advice on what can i >> do with this? Thanks for your help and consideration. >> >> On Thu, Mar 19, 2015 at 2:51 PM, Dominik Stadler <[email protected]> >> wrote: >> >> Hi, >>> >>> As the XSSF implementation is fundamentally based on having all >>> elements in memory, there will always be a file size which exceeds >>> that available memory. How big are your files? I.e. are you just a bit >>> over the available memory or a lot? >>> >>> Maybe you can do a heapdump using the Java flags as explained at >>> http://stackoverflow.com/a/543037/411846. Then using a tool like >>> Eclipse MAT you can analyze the resulting hprof-dump to find out which >>> parts use up most of the memory, this might at least tell us if it is >>> feasible to try to reduce memory usage. >>> >>> Don't know about Pivot table functionality, so cannot say how much >>> effort it would be to add it to the SXSSF implementation. >>> >>> Thanks... Dominik. >>> >>> On Thu, Mar 19, 2015 at 8:16 PM, Carlos Arroyo >>> <[email protected]> wrote: >>> >>>> Hi, I would like to subscribe on this page to share knowledge and ask >>>> questions about POI. I'm a developer and I'm using POI to create a very >>>> large Excel file. The problem is that I'm having memory issues because >>>> >>> I'm >>> >>>> using XSSFWorkbook and this uses a lot of memory. I could do it with >>>> SXSSFWorkbook to solve the memory issue but I have to create pivot >>>> tables >>>> and these tables are only available within XSSFWorkbook sheets, so I >>>> want >>>> to know if there's a way to solve this problem.1- Maybe implement pivot >>>> tables in SXSSFWorkbooks 2- Fix the memory issue with XSSFWorkbooks. >>>> >>> Thanks >>> >>>> for your help. >>>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >>> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
