CodeIgniter Used MEMORY by profiler |
[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?
[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)
[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. |
Welcome Guest, Not a member yet? Register Sign In |