FileInputStream不行,那你用BufferedInputStream来试试,看是否可以呢,我也没试过这么大的excel文件。

解决方案 »

  1.   

    excel数据表记录为2万条
    我10万都没有问题的,你虚拟机内存设过没有,报out of memory还是什么溢出,把错误贴上来
      

  2.   

    调大JVM的可支配内存,一般有256MB以上比较好。
      

  3.   

    楼上调jvm的内存也是一个办法,还有就是对你的代码进行优化。比如我上面说的用BufferedInputStream,异常的嵌套等等和效率有关的东东。
      

  4.   

    好像不行吧,excel好像最多支持3万多条,还是2完多条。^_^
    excel有限制。
      

  5.   

    Excel每个Sheet最多支持65535条记录。Column是每个Sheet最多255。
      

  6.   

    很多天了,一直未能解决,今天再顶!Event-Driven Reading
    The event-driven API for reading documents is a little more complicated and requires that your application know, in advance, which files it wants to read. The benefit of using this API is that each document is in memory just long enough for your application to read it, and documents that you never read at all are not in memory at all. When you're finished reading the documents you wanted, the file system has no data structures associated with it at all and can be discarded.但是一直找不到相关操作的例子,不知道POIFSReaderListener实现接口类中具体如何获取HSSFRow实例?
      

  7.   

    一個單元格最多有多少個字符。excel不是無限大的。當大於最大值時就會出錯了。個人意見!
      

  8.   

    Event-Driven Reading
    The event-driven API for reading documents is a little more complicated and requires that your application know, in advance, which files it wants to read. The benefit of using this API is that each document is in memory just long enough for your application to read it, and documents that you never read at all are not in memory at all. When you're finished reading the documents you wanted, the file system has no data structures associated with it at all and can be discarded.但是一直找不到相关操作的例子,不知道POIFSReaderListener实现接口类中具体如何获取HSSFRow实例?
      

  9.   

    Excel大数据量问题,见了就顶……等待高手出招……
      

  10.   

    Excel每个Sheet最多支持65535条记录。Column是每个Sheet最多255。
    数据量大时内存溢出,建议边读数据库边写入excel,这样的话可以达到20m;我把结果集放到hashtable,vecter中让后再写入excel,就会出现内存溢出现象。调jvm的内存也是一个办法,如果注意要调整服务器虚拟内存;
      

  11.   

    现在流行的操作excel的方法无外乎poi和jxl,我做过这两个的简单写测试,poi的效率和内存消耗都要大于jxl,但是OOM是两者都无法根本解决的问题,对于太大的Excel文件是肯定会出问题的,一般的通过-Xmx来指定最大的JVM内存可以在一定程度上解决问题。换用BufferedInputStream并不能解决问题的,这两个(至少jxl我确定)是会将整个Excel文件读入内存的。即便是能够解决一个文件加载的问题,在并发数多的时候,系统还是会被down掉的,如果Excel简单只是单独的一行行数据的话,就用纯文本来加载吧。