jasonrogena / jasonrogena/php-excel-reader

Memory Exhaust on $streamdata variable

Open
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-migrated Priority-Medium Type-Defect
Dominant language
PHP
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I'm getting a memory error on the

getWorkBook function

so on line ~238 
$streamData .= substr($rootdata, $pos, SMALL_BLOCK_SIZE);

I've already changed the max execution limit (0) and memory limit in my 
.ini file is at 200M. I've also included the error reporting line for E_ALL 
and E_NOTICE. For one, I installed AppServ on a Dell GX620 with 3.2Ghz P4 
with 1 gig of ram on winxp. So, the AppServ and system aren't the greatest 
but that's all I had to work with to access the local excel files. Next, 
I'm looping through a readdir of about 2000 excel files (160M) in order to 
extract a few bits of info from each. My script gets through about 1700 xls 
files and extracts the info I need but it's not making it past the last 
200-300. So, I'm really at a lost cause the scripts working great and I've 
already changed the GetInt4d and _GetInt4d (magical??)functions but I'm on 
32bit archy so results have been the same. I've also been unsetting 
variables left and right. 

I know there may be some problems due to the crap machine or AppServ quick 
AMP install, but everything seems to be working and all the paths look good 
to me. 

Any suggestions on what I can try to get my script to finish to completion. 
All I need is the data so the extended info cells is turned off (false) and 
I hardcoded that in the function cause I think there were problems with the 
call always being on, but I want to say the read() still wants to get 
additional cell info which may be pushing the data chunks or memory limits.

Thanks for any ideas for me to try. Otherwise, very nice update to the 
sourceforge and works in many other instances for me at 100% but this one 
time I'm only getting about 90% completion.  

Original issue reported on code.google.com by charlier...@gmail.com on 9 Oct 2009 at 9:20

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at getWorkBook around line 238 and reproduce the loop over roughly 2,000 XLS files while watching memory used by $streamData. Done means identifying why processing stops near the final 200–300 files and verifying a fix that completes the batch without exhausting memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.