The problem started when I wrote the above function in the model, to better separate the codes, did so; (model)
Error: Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 261900 bytes) in C:\Apache2.2\htdocs\yiiadministracao\protected\modules\administracao\models\ProdutosCategorias.php on line 71
the above code may be or may not reflect the problem cause above memory allocate exhausted,
in my case, make a breakpoint that yrs main class/es causing error, use independent unit test that find out why it allocate so more memory, by using loop? by allocate class memory?, by new (not assign) so much duplicate var that useless or just little work?
that is my past solution. Debug is time consuming, refactoring should be need.