Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 71 bytes)

Topics: User Forum
Nov 23, 2007 at 6:25 AM
Hello,

Sorry for my english, I'm french!

So, I tried to execute the test file : 14excel5.php and i have a fatal error :

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 71 bytes) in C:\wamp\www\excel\lib\PhpExcel\Classes\PHPExcel\Style\Borders.php on line 340

How can i change the memory allocated ?

I don't undestand why for a small excel file, i have a fatal error memory.

PhpExcel need large memory to run ? What is the minimal requirement of memory ?

Thanks for your reply.

Eric.
Coordinator
Nov 26, 2007 at 6:04 AM
On which file are you testing the reader? 05featuredemo.xlsx?
Nov 26, 2007 at 5:59 PM
Hello;

Same problem here. I am trying to generate an excel 5 file. I have an array with the values and another one with positions.
IE: $positions0='A1';$positions1='D1';
$values0='hello';$values1=17;

So my code is as follows...
for($i=0;$i<count($positions);$i++){
//echo $posiciones$i.' '.$valores$i.'<br>';
$objPHPExcel->getActiveSheet()->setCellValue($positions$i, $values$i);
}

It is ok if array length is less than 100, but if it is bigger...
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 648 bytes) in ...etc

I will be trying other ways to solve this, but do you have any idea? Thanks in advance, great job!
Nov 26, 2007 at 6:53 PM
Hello;

Again. I just changed my "allowed memory" and it works. But is it possible that 100 cells exceed 8 mb?

Best regards and thanks for this usefull tool
Coordinator
Nov 26, 2007 at 8:57 PM
Memory limit of 8MB is a bit low for PHPExcel I'm affraid. Try setting it to 32MB - 64MB, this is usually enough for non-heavy use.
Nov 27, 2007 at 6:20 AM
Hello,

I'm testing the file 14excel5.php in the directory Tests/.

-> http://localhost/excel/lib/PhpExcel/Tests/14excel5.php

I changed the allowed memory in php.ini (64M) and it works.

I don't knom if i can use this PDF library in production environnement because i will have to generate Excel files with thousands of lines...

Have you a table wich contains the memory to allocated correspondants to the number of lines possible in the excel file ?

Thanks.
Coordinator
Nov 27, 2007 at 9:22 AM
Check 06largescale.php, the source code contains a comment about that.
Nov 27, 2007 at 9:49 AM
Ok thanks.

Number of rows Seconds to generate
200 3
500 4
1000 6
2000 12
4000 36
8000 64
15000 465

These statistics are for excel 2007.

Do you think, it will take less time for excel 95 ?
Coordinator
Nov 28, 2007 at 7:05 PM
This should be about the same I think.