Doctrine 1
  1. Doctrine 1
  2. DC-644

_getCacheKeys() exhausts memory

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Caching
    • Labels:
      None
    • Environment:
      Doctrine is installed as a Symfony plugin. Using the latest Symfony from SVN.

      Description

      My scripts have excessive memory consumption and I've often saw in my logs:

      PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 2097152 bytes) in /proj/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cache/Apc.php on line 111

      Looking into the code I've found which function to blame:

      protected function _getCacheKeys()
      {
      $ci = apc_cache_info('user');
      $keys = array();

      foreach ($ci['cache_list'] as $entry)

      Unknown macro: { $keys[] = $entry['info']; ######### THIS IS THE LINE }

      return $keys;
      }

      My server extensively uses APC caching and it's normal to have many cache keys.
      Obviously retrieving ALL of them is time and memory consuming.
      As I'm not well versed with Doctrine's code, I didn't want to dive further in.

      Is there another way to avoid this pitfall?

        Activity

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Amir W
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: