Re: Memory Consumption of Associated Models?
Sorry, i must have been blind. However, it shouldn't be that hard to write your own behaviour that back ups the original associations and manages binding/unbinding by simple identifiers. Regards O.J. Tibi schrieb: > Hi Odd, > > As I said earlier, the Containable behavior doesn't work for the > number of PHP objects (models) loaded in-memory, so no dice here. :) > > On Nov 25, 3:27 pm, odd wrote: > > Give containable a try: > > > > http://book.cakephp.org/view/1323/Containable > > > > Regards Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Memory Consumption of Associated Models?
Maybe this can help you, http://www.joelango.com/2007/04/30/why-you-should-never-use-select-star/ am I guess using load model and bind model on the fly will help you. On Thu, Nov 25, 2010 at 1:54 PM, O.J. Tibi wrote: > Hi Odd, > > As I said earlier, the Containable behavior doesn't work for the > number of PHP objects (models) loaded in-memory, so no dice here. :) > > On Nov 25, 3:27 pm, odd wrote: > > Give containable a try: > > > > http://book.cakephp.org/view/1323/Containable > > > > Regards > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Vivi http://photos.vr-3d.net Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Memory Consumption of Associated Models?
Hi Odd, As I said earlier, the Containable behavior doesn't work for the number of PHP objects (models) loaded in-memory, so no dice here. :) On Nov 25, 3:27 pm, odd wrote: > Give containable a try: > > http://book.cakephp.org/view/1323/Containable > > Regards Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Memory Consumption of Associated Models?
Give containable a try: http://book.cakephp.org/view/1323/Containable Regards Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Memory Consumption of Associated Models?
Hi all, I recently ran into a speedbump with our application. I have this model that has about 18 declared associations (excluding circular references/recursions generated by CakePHP). I noticed OOM errors happening on our test server and made some quick detective work on our models, which lead me to our "main" application model. Doing a debug_backtrace() inside the model class, I noticed that the total dump (not the raw binary value) of the backtrace array easily exceeded 100MB, which in any web app, is way too much. Just to prove the point, I tried trimming the associations within the model, and the application ran (with "not associated" model errors, of course). Is there any way to curb or control the number of models loaded into memory, specially when they are not used during runtime? I also read about the lazy-loading plugins by Matt Curry and Lorenzo Rodríguez that load the associated models only when they are needed, but for this project I was thinking if there was a way to do the same thing without using plugins? The Containable behavior only works for queries, not for the in-memory PHP objects. I'm thinking that bindModel() calls on-the-fly are the only way to conserve memory, downside is I have to write the bindModel() code in places where the associations would be used, which are a lot. Suggestions would be deeply appreciated. Cheers, OJ Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en