Closed (fixed)
Project:
Webform
Version:
6.x-2.9
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Jul 2010 at 03:22 UTC
Updated:
22 Jul 2010 at 06:40 UTC
There is a weird bug (that was essentially causing a large memory leak when generating big CSV files) in the webform_get_submission() function.
For some reason the $submissions = array(); at the start of the webform_get_submission method was setting the $submissions variable as static. This was meaning when there is a LARGE csv to be exported, the memory usage grows massively. It's essentially a memory leak.
Applicaiton memory is not the best place to put this sort of stuff in our experience.
The code probably needs to be refactored slightly (removed $reset) ... however this fixes the memory leak.
| Comment | File | Size | Author |
|---|---|---|---|
| webform_submissions.inc_.patch | 626 bytes | AndrewBoag |
Comments
Comment #1
AndrewBoag commentedIn retrospect, this probably isn't a critical bug and I understand that you are trying to not pound the database with requests for the same submission. However, with large numbers of submissions this will cause issues.
Comment #2
quicksketchI probably won't be changing the behavior of the 2.x version at all at this point. 3.x still uses the same code and I don't think it's likely that you'd load more than a single submission in a request. Individual submissions are not actually loaded when downloading CSVs, they use webform_get_submissions() which does not include a static cache for the reasons you describe. So in short, if you load a single submission, the submission is cached, but if you load multiple, they are not.