title: Magento frustrating memory limit
body: <p>I am working with Magento for quite some time, but recently i am getting frustrated as I am getting an "Allowed memory size" error. This is usually fixed (from my understanding) by increasing the "php_value memory_limit" in the related .htaccess file which I have set to a high value since the day I launched my store. </p>
  
  <p>In any case though I am recently getting the following errors in my error_log:</p>
  
  <pre><code>    PHP Fatal error:  Allowed memory size of 52428800 bytes exhausted (tried to allocate 10282 bytes) in /home/store/public_html/includes/src/__default.php on line 2976
      PHP Fatal error:  Allowed memory size of 52428800 bytes exhausted (tried to allocate 32 bytes) in /home/store/public_html/includes/src/__default.php on line 56485
      PHP Fatal error:  Allowed memory size of 52428800 bytes exhausted (tried to allocate 77 bytes) in /home/store/public_html/includes/src/__default.php on line 56485
  </code></pre>
  
  <p>If it helps I will point out the related lines as follow. (the lines in questions are marked with ** **)</p>
  
  <p>2976:</p>
  
  <pre><code>    try {
          $includeFilePath = realpath($this-&gt;_viewDir . DS . $fileName);
          if (strpos($includeFilePath, realpath($this-&gt;_viewDir)) === 0 || $this-&gt;_getAllowSymlinks()) {
              **include $includeFilePath;**
          } else {
              Mage::log('Not valid template file:'.$fileName, Zend_Log::CRIT, null, null, true);
          }
  </code></pre>
  
  <p>56485:</p>
  
  <pre><code>public function fetchAll($style = null, $col = null)
  {
      if ($style === null) {
          $style = $this-&gt;_fetchMode;
      }
      try {
          if ($style == PDO::FETCH_COLUMN) {
              if ($col === null) {
                  $col = 0;
              }
              return $this-&gt;_stmt-&gt;fetchAll($style, $col);
          } else {
              **return $this-&gt;_stmt-&gt;fetchAll($style);**
          }
      } catch (PDOException $e) {
          #require_once 'Zend/Db/Statement/Exception.php';
          throw new Zend_Db_Statement_Exception($e-&gt;getMessage(), $e-&gt;getCode(), $e);
      }
  }
  </code></pre>
  
  <p>What seems strange to me here are the "52428800 bytes" which from my understanding translate to 50MB. Where could these 50MB be predefined? I clearly checked my php info and the value is nowhere to be seen, also the "php_value memory_limit" corresponds to what I have defined earlier and is nowhere close to 50MB.</p>
  
  <p>My Magento setup:</p>
  
  <ul>
  <li>Magento 1.5.10</li>
  <li>Memcache enabled</li>
  <li>Compilation enabled</li>
  </ul>
  
  <p>Hardware setup:</p>
  
  <ul>
  <li>VPS with 12GB RAM</li>
  <li>WHM / cPanel</li>
  <li>NginxCP</li>
  </ul>
  
  <p>Current PHP configuration:</p>
  
  <ul>
  <li>Default PHP Version (.php files) 5</li>
  <li>PHP 5 Handler    dso</li>
  <li>PHP 4 Handler    none </li>
  <li>Apache suEXEC    on</li>
  <li>Apache Ruid2         on</li>
  </ul>
  
  <p>I would be really thankful if someone someone is able to point me in the right direction on how to have this issues resolved. Thank you.</p>