Click here to Skip to main content
15,895,142 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
SuggestionRe: Linux Distribution Pin
Mohibur Rashid1-Dec-11 19:44
professionalMohibur Rashid1-Dec-11 19:44 
AnswerRe: Linux Distribution Pin
DigiOz Multimedia5-Dec-11 4:39
DigiOz Multimedia5-Dec-11 4:39 
GeneralRe: Linux Distribution Pin
Albert Holguin5-Dec-11 4:51
professionalAlbert Holguin5-Dec-11 4:51 
AnswerRe: Linux Distribution Pin
loctrice29-Dec-11 17:16
professionalloctrice29-Dec-11 17:16 
QuestionImport Google contacts using Authsub(Secure connection) Pin
Paresh14621-Nov-11 3:31
Paresh14621-Nov-11 3:31 
QuestionHow to debug PHP Memory Leak Pin
Logan Black30-Oct-11 14:17
Logan Black30-Oct-11 14:17 
AnswerRe: How to debug PHP Memory Leak Pin
Logan Black30-Oct-11 16:00
Logan Black30-Oct-11 16:00 
AnswerRESOLVED: How to debug PHP Memory Leak Pin
Logan Black30-Oct-11 17:10
Logan Black30-Oct-11 17:10 
Ok, I have added to it and resolved the problem.

The problem was two fold.

1 - I wasn't using ob_flush() inside the while loop. I added that in and it appeared to free up a lot of memory, enabling larger downloads, but not unlimited.

For example, with memory_limit = 128M i could now download more than 40mb, in fact i could now get up to around 200mb. But this is where it failed again. First memory issue problem solved though.

LESSON 1: Flush your objects!

2 - I was using mysql_query to retrieve the results for my SQL Query. The problem is that it buffers these results, and this was adding to my memory limit issue.

I ended up using mysql_unbuffered_query instead and this now works flawlessly.

This does however come with some limitations, that it locks your table while reading results.

LESSON 2: Don't buffer mysql results if not required! (within programmatic limitations)

FINAL LESSON:

All of these fixes work, however, it requires some more testing to ensure that there is no problems with the combination of them.

Also, I have learned a lot more about objects and php memory allocation, I just wish there was a way to visually debug the process a little better than what xdebug offers. If anyone has any ideas on how xdebug could have actually shed some light on this process, please let me know in the comments.

Hope this helps someone else out in the future.
GeneralRe: RESOLVED: How to debug PHP Memory Leak Pin
Mohibur Rashid31-Oct-11 18:01
professionalMohibur Rashid31-Oct-11 18:01 
QuestionProblem receiving arabic emails Pin
Jassim Rahma27-Oct-11 7:38
Jassim Rahma27-Oct-11 7:38 
AnswerRe: Problem receiving arabic emails PinPopular
Graham Breach27-Oct-11 9:26
Graham Breach27-Oct-11 9:26 
QuestionHow to make a Cloud text from database Pin
Jassim Rahma26-Oct-11 10:58
Jassim Rahma26-Oct-11 10:58 
AnswerRe: How to make a Cloud text from database Pin
User 171649226-Oct-11 11:39
professionalUser 171649226-Oct-11 11:39 
QuestionFacebook-Like modal box Pin
Jassim Rahma25-Oct-11 6:26
Jassim Rahma25-Oct-11 6:26 
AnswerRe: Facebook-Like modal box Pin
Mohibur Rashid25-Oct-11 15:40
professionalMohibur Rashid25-Oct-11 15:40 
Questionsignature_invalid in Google API Pin
Paresh146225-Oct-11 2:36
Paresh146225-Oct-11 2:36 
AnswerRe: signature_invalid in Google API Pin
Niall Barr26-Oct-11 3:21
professionalNiall Barr26-Oct-11 3:21 
Questiondata was not displayed in the application in the correct format. Pin
Honeyboy_2025-Oct-11 1:01
Honeyboy_2025-Oct-11 1:01 
AnswerRe: data was not displayed in the application in the correct format. Pin
cjoki4-Nov-11 10:30
cjoki4-Nov-11 10:30 
QuestionBest Practices - mysql calls Pin
Dwayner7920-Oct-11 13:59
Dwayner7920-Oct-11 13:59 
AnswerRe: Best Practices - mysql calls Pin
Mohibur Rashid21-Oct-11 0:02
professionalMohibur Rashid21-Oct-11 0:02 
GeneralRe: Best Practices - mysql calls Pin
Dwayner7923-Oct-11 7:40
Dwayner7923-Oct-11 7:40 
GeneralRe: Best Practices - mysql calls Pin
Mohibur Rashid23-Oct-11 12:05
professionalMohibur Rashid23-Oct-11 12:05 
QuestionUsing MSSQL stored procedure with codeigniter Pin
noadek20-Oct-11 6:43
noadek20-Oct-11 6:43 
QuestionAverage Disk Queue Length In Linux Pin
ReaperDR17-Oct-11 2:52
ReaperDR17-Oct-11 2:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.