Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backup_faves.php runs out of memory #19

Open
mojodna opened this issue Feb 5, 2012 · 3 comments
Open

backup_faves.php runs out of memory #19

mojodna opened this issue Feb 5, 2012 · 3 comments

Comments

@mojodna
Copy link

mojodna commented Feb 5, 2012

My memory_limit = 32M (in /etc/php5/cli/php.ini), what's yours?

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 14158845 bytes) in /home/seth/www/parallel-flickr/www/include/lib_http.php on line 238
@mncaudill
Copy link
Contributor

My thought is that 32 megabytes should be enough for anyone (to paraphrase Mr. Gates), but maybe that's not the case. My instinct was that there was a place where a good unset would have fixed things, but I ran xdebug and xhprof over the backup_faves script and nothing jumped out at me.

I'll try to poke some more tonight if I can find the leak, or if it's not a leak, figure out how to keep less stuff in memory at one time (which may just be the whole issue).

@mojodna
Copy link
Author

mojodna commented Feb 6, 2012

I switched it fairly arbitrarily to 128M and it's been running beautifully.

@straup
Copy link
Owner

straup commented Feb 6, 2012

Yeah, this one puzzles me. The basic change is around the pre-bucketing of contact hashes in an array during the fetch from the Flickr API and then adding them one at a time.

Previously they would be added as they were retrieved because the old set (of contacts) had already been purged from the database.

That just doesn't seem like the kind of thing to make the memory requirements go all loopy. The only other notable change is the retry code for the Flickr API but, again, that just doesn't seem likely.

Which leaves something squirrel-y happening in a while loop but I can't see it yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants