Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-644

_getCacheKeys() exhausts memory

    Details

    • Type: Bug
    • Status: Open
    • Priority: 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

        colnector Amir W created issue -
        colnector Amir W made changes -
        Field Original Value New Value
        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) {
                  $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?

        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:
        {quote}
            protected function _getCacheKeys()
            {
                $ci = apc_cache_info('user');
                $keys = array();

                foreach ($ci['cache_list'] as $entry) {
                  $keys[] = $entry['info']; ######### THIS IS THE LINE
                }
                return $keys;
            }
        {quote}

        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?
        romanb Roman S. Borschel made changes -
        Assignee Roman S. Borschel [ romanb ] Jonathan H. Wage [ jwage ]

          People

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

            Dates

            • Created:
              Updated: