Render memory accumulates and crashes in loop
Posted: Sat May 04, 2013 10:19 pm
Scenario:
8 mile long survey is the x axis in feet
y axis is field survey readings at intervals ranging from 2.5 to 7 feet
This results in 6552 data points that require printing at 50 data points per page.
Rough example:
php code to divide into pages with instructions for row # start and end to be selected from database (sql) for each page
then... FOREACH{ page
build the chart
render (puts a copy in the directory even though "file save" instructions feature not working).
back to top of loop for next page select data and build chart, etc.
} end foreach
These eventually have to be PDF and each image is rendered at 1000x600.
After just 14 (137 printed pages required for this 8 mile survey), I get this..
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1000 bytes) in C:\xampp\htdocs\................\sources\GraphicsGD.php on line 587
I do not have an option for blob in database or text file of just image data (which probably would not work either if TeeChart still has to render the data out -- which is where the memory accumulates) and the SVG is not working to play with that (like I said, they eventually have to go to single PDF and it may be possible to save the image data in a way that PDF can be built rather than saving PNG or JPEG) -- but again, those options are not available.
So why is not the memory relieved (imagedestroy) after each render? The image memory accumulates and crashes, how can this be relieved to start each chart fresh at top of loop with no memory of the one before?
8 mile long survey is the x axis in feet
y axis is field survey readings at intervals ranging from 2.5 to 7 feet
This results in 6552 data points that require printing at 50 data points per page.
Rough example:
php code to divide into pages with instructions for row # start and end to be selected from database (sql) for each page
then... FOREACH{ page
build the chart
render (puts a copy in the directory even though "file save" instructions feature not working).
back to top of loop for next page select data and build chart, etc.
} end foreach
These eventually have to be PDF and each image is rendered at 1000x600.
After just 14 (137 printed pages required for this 8 mile survey), I get this..
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1000 bytes) in C:\xampp\htdocs\................\sources\GraphicsGD.php on line 587
I do not have an option for blob in database or text file of just image data (which probably would not work either if TeeChart still has to render the data out -- which is where the memory accumulates) and the SVG is not working to play with that (like I said, they eventually have to go to single PDF and it may be possible to save the image data in a way that PDF can be built rather than saving PNG or JPEG) -- but again, those options are not available.
So why is not the memory relieved (imagedestroy) after each render? The image memory accumulates and crashes, how can this be relieved to start each chart fresh at top of loop with no memory of the one before?