CodeIgniter Used MEMORY by profiler - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CodeIgniter Used MEMORY by profiler (/showthread.php?tid=55804) |
CodeIgniter Used MEMORY by profiler - El Forum - 11-10-2012 [eluser]pisio[/eluser] Hey ! I have strange question. Pro filer tells me Quote: MEMORY USAGEIs it possible ? Is there any option to see what model / controller / lib how much memory used? Because I think these 7 mb too much. Also on the site is shared hosting, not VPS, it reflects you somehow these statistics? CodeIgniter Used MEMORY by profiler - El Forum - 11-14-2012 [eluser]Stoney[/eluser] 7MB can be too much... I have a custom developed CMS, with 3.2MB-s used. You can try https://github.com/lonnieezell/codeigniter-forensics for detailed analysis. It has some nice features like: Code: Console::log_memory($variable, $name) CodeIgniter Used MEMORY by profiler - El Forum - 11-14-2012 [eluser]Narf[/eluser] PHP itself takes a half of that. When the PHP binary is executed, by default all of its compiled modules will be loaded as well. The more extras you have - the more memory they will eat. Also, exactly for the purposes of profiling, in order to be able to display database queries, CodeIgniter will store them all in a property. Again, this is by default and you can turn it off: Code: $this->db->save_queries = FALSE; ... or in your config/database.php: Code: $config['default']['save_queries'] = FALSE; Additionally, in order to prevent repeating calls to a database - results from them are cached in the DB_result objects as well. So unless you unset those and if you're dealing with large chunks of data - it is normal that it takes up some memory. |