Skip to main content
Participant
March 1, 2017
Question

CFSpreadsheet fails to read atleast one row if the excel file size is big

  • March 1, 2017
  • 2 replies
  • 966 views

CFSpreadsheet fails to read atleast one row if the excel file size is big. I am trying to read a excel file of size say 20mb. But it is giving java heap space error when reading the whole file. But when I specify the row attribute, it is not able to read even one row from the big file. Please help me on this issue.

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    March 6, 2017

    The memory problem in cfspreadsheet has been known for some time. Most of ColdFusion's spreadsheet functionality is based on the POI library. The version of POI which ColdFusion implements is the User API. This loads the entire document into memory. That is what causes the out-of-memory error when you read a large Excel file.

    I am sorry to say, I don't think there is currently any way to work around this problem in ColdFusion. Nevertheless, there are two possible solutions, in Java, also provided by Apache POI, namely its Event API or Streaming Usermodel API.

    Inspiring
    March 1, 2017

    How much memory on the server and how much memory is CF / JVM configured to use?

    Participant
    March 1, 2017

    Minimum JVM Heap Size (in 256 MB)   Maximum JVM Heap Size (in 1024 MB)    . I am trying to do it in CF2016 developer edition. I tested it in my dev server with higher configuration as well. same behaviour.

    Server Details
    Server Product ColdFusion 2016
    Version 2016.0.03.300466
    Tomcat Version 8.0.32.0
    Edition Developer  
    Operating System Windows 10  
    OS Version 10.0  
    Update Level C:/ColdFusion2016/cfusion/lib/updates/chf20160003.jar  
    Adobe Driver Version 5.1.4 (Build 0001)