Memory issues and caching...

May 20, 2010 at 10:35 PM
Hey all, I am trying to write an export that takes data from mysql and puts it into excel. When doing so with just a few rows it works great, but my database has up to 13000 rows. Running the script on that runs out of memory. I was wondering what a good way to avoid this is. I tried to use the new caching functions, but to be honest, I am not sure how to do so. Is there any examples of it being used? Do I simply add the lines $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_discISAM; PHPExcel_Settings::setCacheStorageMethod($cacheMethod); to my code before I create my PHPExcel object? Any help would be appreciated. Thanks a ton.
May 21, 2010 at 3:44 PM
Edited May 21, 2010 at 3:44 PM
So, Ive been testing my memory usage using the different caching methods and for some reason it actually increases when using every caching method. Some increase it more then others. How is that possible? Why is it causing me to use MORE memory. My simple output of 13000 rows of 1 column takes roughly 60MB with no caching, and it takes like 62-65 with, thats all very bizarre to me. Any idea what is happening?
May 26, 2010 at 9:33 AM

The problem appears to be memory leaks within some of the writers, and the latest SVN code contains a number of fixes that reduce these problems (although they are not eliminated completely).

When using cell caching, the memory used by the PHPExcel object is reduced, but the writers appear to clone parts of this causing the memory leaks. The changes that I have made reduce the problem without completely eliminating the issue. A script that uses the cell caching should now use less memory than the equivalent script against the 1.7.2 release, whichever writer is being used, but eliminating the memory leaks completely will be an ongoing process.

May 28, 2010 at 9:33 AM
i have the same problem, but didn't can use class PHPExcel_CachedObjectStorageFactory, i have this message Class 'PHPExcel_CachedObjectStorageFactory' not found i use symfony 1.3 , and plugin sfPhpExcelPlugin 1.0.3