Allowed Memory Size Exhausted

I am continuously getting allowed memory size exhausted error at my yii application (version 1.1.13). Below are the files with line no where I am getting the issue -

  1. base/CModule.php on line 103

100: public function __get($name)

101: {

102: if($this->hasComponent($name))

[color="#FF0000"]103: return $this->getComponent($name);[/color]

104: else

105: return parent::__get($name);

106: }

  1. web/auth/CWebUser.php on line 567

565: public function getState($key,$defaultValue=null)

566: {

[color="#FF0000"]567: $key=$this->getStateKeyPrefix().$key;[/color]

568: return isset($_SESSION[$key]) ? $_SESSION[$key] : $defaultValue;

569: }

I set the memory limit to 512M & 1GB, but its not resolving the issue.

Please Help!!!

Are you reading a lot of AR models?

We have lot of AR models in our application but we are reading only few. For more information we are getting the error few times at staging server only (ubuntu) and even at the login page where we are reading only 3 AR models. At our local environment (windows with 512MB memory limit) its working fine without any memory issue.

We have set the import path at our application config file for all AR models that I believe is for autoloading only.

Attaching the wincachegrind screenshot, its showing that the CModule->getComponent is getting called 91 times.

We tracked the fatal error and found that the out of memory issue is occurring during the initialization of yii - ‘user’ component. I am using allowAutoLogin for user component configuration.