PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi,
I am working with php5 and i have a script that should have to be executed as a cron. The main purpose of the script is to send reports as pdf files to different users. The problem is when i generate a number of pdfs, the script fails to complete the process and results in display a page with network error. It is creating around 6 types of pdf files in each execution, each having an average size of 500 KB. The memory_get_usage() returns the value -51507298 after a function call in ezpdf library. just before the function call the value for the same was 1967298. Default php.ini setting for memory_limit is 50 MB. I have set the memory limit in the script to 500 MB.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
The memory_get_usage() is called where the * marks are given (it gives the previously mentioned results) and the function i used is in between the * marks.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I took a gander at the source for that ezpdf function and it a convoluted mess. I am assuming that it is sucking up a ton of resources looping through your data. How many records are you passing it? You might want to either limit the number of records sent to that method at a time or create a workaround to not use that method.
Sometimes i have to pass around 1500 records to the ezTable() function.
i have tried to split it and reduced to 500 records.. but still the same problem exists.