title: Cannot get cell caching to work in PHPExcel
body: <p>I've tried every method in the PHPExcel 1.7.8 manual for cell caching, but none work. I still run out of memory every time I try to load an Excel file of about 30 MB.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    ini_set('memory_limit', '256M'); // Up from default 32MB
  
      require MODULES_DIR . '/PHPExcel.php';
  
      $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_discISAM;
      $cacheSettings = array('dir' =&gt; '/usr/local/tmp');
      PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
  
      $inputFileType = PHPExcel_IOFactory::identify($dir . $source_file);
  
      $objReader = PHPExcel_IOFactory::createReader($inputFileType);
  
      $objReader-&gt;setReadDataOnly(true);
  
      $objPHPExcel = $objReader-&gt;load($dir . $source_file);
  
      $total_sheets = $objPHPExcel-&gt;getSheetCount();
      $allSheetName = $objPHPExcel-&gt;getSheetNames();
  
      $objWorksheet = $objPHPExcel-&gt;setActiveSheetIndex(0);
  
      $highestRow = $objWorksheet-&gt;getHighestRow();
      $highestColumn = $objWorksheet-&gt;getHighestColumn();
  
      $headingsArray = $objWorksheet-&gt;rangeToArray('A1:'.$highestColumn.'1',null, true, true, true);
      $headingsArray = $headingsArray[1];
  
      $r = -1;
      $namedDataArray = array();
  
      for ($row = 2; $row &lt;= $highestRow; ++$row) {
          $dataRow = $objWorksheet-&gt;rangeToArray('A'.$row.':'.$highestColumn.$row,null, true, true, true);
  
          if ((isset($dataRow[$row]['A'])) &amp;&amp; ($dataRow[$row]['A'] &gt; '')) {
              ++$r;
  
              foreach($headingsArray as $columnKey =&gt; $columnHeading) {
                  $namedDataArray[$r][$columnHeading] = $dataRow[$row][$columnKey];
              }
          }
      }
  </code></pre>
  
  <p>I've tried every one of the cell caching mechanisms all the way down to "cache_to_sqlite3" but none of them work.</p>
  
  <p>Can someone tell me what I am doing wrong here?</p>
  
  <p>EDIT: Apparently I skipped over the "cache_to_sqlite" option. I tried that and it started caching. However, it still runs out of memory during the caching process on a 30 MB file with 256MB of memory available. Here is the error:</p>
  
  <pre><code> Fatal error: Uncaught exception 'Exception' with message 'out of memory' in modules/PHPExcel/CachedObjectStorage/SQLite.php:64 Stack trace: #0 modules/PHPExcel/CachedObjectStorage/SQLite.php(81): PHPExcel_CachedObjectStorage_SQLite-&gt;_storeData() #1 modules/PHPExcel/Worksheet.php(1123): PHPExcel_CachedObjectStorage_SQLite-&gt;addCacheData('X2498702', Object(PHPExcel_Cell)) #2 modules/PHPExcel/Reader/Excel5.php(3549): PHPExcel_Worksheet-&gt;getCell('X2498702') #3 modules/PHPExcel/Reader/Excel5.php(894): PHPExcel_Reader_Excel5-&gt;_readLabelSst() #4 modules/updater.inc.php(1478): PHPExcel_Reader_Excel5-&gt;load('modules/p...') #5 modules/updater.php(204): Updater-&gt;process_xls('prods.xls') #6 {main} thrown in modules/PHPExcel/CachedObjectStorage/SQLite.php on line 64
  </code></pre>