Well, this is interesting: I've also seen a ballooning of RAM usage (though I wouldn't call it "violent" =P) when loading a spreadsheet and I didn't know about the input-stream vs. file distinction. Although, come to think of it, I'm pulling out of a database so that might not help me.
The excess usage is only temporary, though, right? My small (<100K) spreadsheets seem to take about 50MB, and my large ones (5MB) seem to take about 500MB. On Fri, Dec 2, 2016 at 7:54 AM, Gordon Pettey <[email protected]> wrote: > On Fri, Dec 2, 2016 at 2:41 AM, Javen O'Neal <[email protected]> wrote: > > > CPU pegged due the the Java garbage collector trying to clean up unused > > memory. The out of memory error is raised when the garbage collector > cannot > > free the necessary memory for new objects to be allocated. > > > > Have you read the FAQ yet? https://urldefense.proofpoint. > com/v2/url?u=https-3A__poi.apache.org_faq.html-23faq-2DN10165&d=DgIFaQ&c= > dmLomitc30UP5j2qU8E1rg&r=p42pHJHEwFZOHtVFHKJUdL2fYbroN3 > 3stXXb3Psthjw&m=K-mZqLKcau3v-2mO1e7Es8pmREXI9_WkDMs3UxiVEsE&s=_ > gk9WyMdApng32mJ3IDsTgjct7dpw_BenPZP-wdE0fA&e= > > > > On Dec 2, 2016 00:11, "[email protected]" <[email protected]> wrote: > > > > > Hi! > > > > > > I am trying to read a xlsx-file whose size is 7.3M with POI version > 3.15, > > > here is the code: > > > > > > > > > *InputStream is = new FileInputStream(new File(path));//line 1Workbook > > book = new XSSFWorkbook(in);// line 2* > > > When running to line 2,the memory of javaw rised > > > violently from 700M to 1200M,cpu from 10% to 90%,the following > > > is the screenshot of memory dump: > > > > > > > See https://urldefense.proofpoint.com/v2/url?u=http-3A__poi. > apache.org_spreadsheet_quick-2Dguide.html-23Files-2Bvs- > 2BInputStreams&d=DgIFaQ&c=dmLomitc30UP5j2qU8E1rg&r= > p42pHJHEwFZOHtVFHKJUdL2fYbroN33stXXb3Psthjw&m=K-mZqLKcau3v- > 2mO1e7Es8pmREXI9_WkDMs3UxiVEsE&s=Q2dr3Xc2iSpx8HHAAj0kQkGXZYpdBK > 9yZFifR-mQo64&e= , > also. > -- *Blake Watson* *PNMAC* Application Development Manager 5898 Condor Drive Moorpark, CA 93021 (805) 330.4911 x7742 [email protected] <[email protected]> www.PennyMacUSA.com <http://www.pennymacusa.com/>
