Hi everyone,
I ran into a funny thing today that had me a bit confused.
I have two static resources set up that are used to build navigation that allows downloads of those resources. One is a WMV that is 138 MB, the other is a MP4 that is 12 MB. Both static resources are set up the same way: as an attachment, with a custom template, searchable, cacheable. When I try to download the MP4 (a fraction of the file size of the WMV), I get this error message:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 11674758 bytes) in core/model/modx/modparser.class.php on line 120
The far larger WMV downloads without issue. Both files download fine when I access them at their static location on the server (not through MODX as a static resource), so I don't think the problem is regarding MIME type.
As you can see, my PHP memory limit is set to the standard 64 MB. After upping it to 512 MB, the MP4 static resource link downloads fine too. So the problem is resolved, but I'm not entirely pleased with having to up the memory limit to 512.
My question really is regarding why the smaller file caused PHP to run out of memory and the huge file did not. Any ideas as to why this might be the case?
Thanks in advance.
The most likely cause is circular logic generating an infinite loop.
A file or chunk including itself, two chunks including each other, getResourceTag pulling the content field of the resource it's in, etc.