Drawing a feed from a Google calendar with lots and lots of events, two to three hundred distinct events with most of these recurring monthly, ad infinitum.

GCal script fails with error:

Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 2480632 bytes) in /home/.bran/feezell/cms.feezell.com/sites/all/modules/gcal_events/simplepie.inc on line 8589

Execution has failed on the hosted account with the error above. It's also failed on my development environment, which is Apache2Triad with default allocation of memory, running on XP Home with 3.25GB.

Seems like 94MB is a more than reasonable allocation for non-commercial site scripts. I'm guessing GCal Events or Simple Pie is trying to pull, what?, the entire calendar in order to process the 3-5 upcoming events I'm looking for?

Any way small number of upcoming events can be extracted from Google Calendar without trying to swallow the entire elephant?

Comments

Se7enLC’s picture

Try the dev version - that should use a lot less memory. The old version grabs 2500 events from each calendar, which only became a big deal with recurring events. The dev version limits the number of events returned by google, which should help a lot. Let me know if that doesn't work.

jfeezell’s picture

Dev version appears to work, but sporadically, creating other issues.

First - does not work at all on the dev environment, described above. Home page comes up blank.
On the hosted environment, I'm getting a new error, warning, actually, below, related apparently to input filter - I believe I set this one up for "Full HTML." Host, btw, is Dreamhost.

So - dev version appears to be an improvement, but may need additional work.

    * warning: array_filter() [function.array-filter]: The first argument should be an array in /home/.bran/feezell/cms.feezell.com/sites/all/modules/gcal_events/gcal_events.module on line 902.
    * warning: array_filter() [function.array-filter]: The first argument should be an array in /home/.bran/feezell/cms.feezell.com/sites/all/modules/gcal_events/gcal_events.module on line 903.
    * warning: array_filter() [function.array-filter]: The first argument should be an array in /home/.bran/feezell/cms.feezell.com/sites/all/modules/gcal_events/gcal_events.module on line 904.
    * warning: array_filter() [function.array-filter]: The first argument should be an array in /home/.bran/feezell/cms.feezell.com/sites/all/modules/gcal_events/gcal_events.module on line 905.
    * warning: array_filter() [function.array-filter]: The first argument should be an array in /home/.bran/feezell/cms.feezell.com/sites/all/modules/gcal_events/gcal_events.module on line 906.
snovich’s picture

Reporting same issue over here - Running a web-radio site and integrating the show-times/listing w/ gcal. Can't wait to see a fix for this :) kee up the good work!

Se7enLC’s picture

snovich - does the dev version work? that is the fix :-) All I was going to do is tag that one as a regular release once I got time.

snovich’s picture

Much better, thanks!! Still a notice-able difference is site loading speed when the module is on/off - any chance you might be able to add an option into the module setting for the number of events / data from gcal to pull @ each load? Anyways, nice job and thanks for the fix!

Se7enLC’s picture

Pretty sure that option is already in there, in the block settings. In the normal version, it always pulls in a really large number and filters down to the requested number, but in the dev version it will actually only pull the requested number.

Se7enLC’s picture

jfreezel - the error you're seeing isn't actually related to input filters, but to the PHP function "array_filter". It is being used to filter out certain entries from the array of entries in the feed. The actual error is that it is not getting an array when it expects to. Perhaps the array contains only one event, and that is the problem? In any case, the error should only occur in the "day grouping" case - try disabling that feature and see if it works.

sleman’s picture

Had same issue. No reason to pull 2,500 events for an upcoming events calendar. Once I change that, calendar works fine.

Line 547 - gcal_events.module
Change:
  array_push($calendar_xml_array, "max-results=2500", "orderby=starttime", "singleevents=true");
To:
  array_push($calendar_xml_array, "max-results=20", "orderby=starttime", "singleevents=true");
Se7enLC’s picture

The dev version already fixed that, but thanks!

Aldwoni’s picture

When will de dev-version become a normal update of the current version?

shanep’s picture

Subscribing

jdwfly’s picture

Status: Active » Closed (fixed)

This is set per block now so shouldn't be an issue (Check dev). I think a new release for 6.x will be put of soon.