Welcome Guest, Not a member yet? Register   Sign In
Class referencing appears a memory leak
#8

[eluser]dyron[/eluser]
After this issue is driving me crazy I found out that calling
Code:
$this->CI =& get_instance();
in classes increases memory space. Afterwards I replaced all of them with
Code:
$CI =& get_instance();
in each method. Even the Calendaring class uses the first one, so I was unsuspecting do this.

I dumps the variable $CI
Quote:array(1) {
[0]=>
object(Home)#10 (18) {
["_ci_scaffolding"]=>
&bool;(false)
["_ci_scaff_table"]=>
&bool;(false)
["config"]=>
&object;(CI_Config)#3 (2) {...}
["input"]=>
&object;(CI_Input)#7 (4) {...}
["benchmark"]=>
&object;(CI_Benchmark)#1 (1) {...}
["uri"]=>
&object;(CI_URI)#8 (2) {
["router"]=>
&object;(CI_Router)#5 (12) {
["config"]=>
&object;(CI_Config)#3 (2) {...} Why not point to the first CONFIG?
...
}
["output"]=>
&object;(CI_Output)#6 (4) {...}
["lang"]=>
&object;(MY_Language)#9 (3) {...}
["load"]=>
&object;(CI_Loader)#11 (11) {...}
["db"]=>
&object;(CI_DB_mysqli_driver)#12 (27) {...}
["session"]=>
&object;(CI_Session)#14 (9) {...}
["calendar"]=>
&object;(MY_Calendar)#16 (9) {...}
["layout"]=>
&object;(Layout)#18 (1) {...}
["page"]=>
&object;(Page)#17 (11) {...}
["blog"]=>
&object;(Blog_model)#21 (16) {
["_parent_name"]=>
string(10) "Blog_model"
["_ci_scaffolding"]=>
&bool;(false)
["_ci_scaff_table"]=>
&bool;(false)
["config"]=>
&object;(CI_Config)#3 (2) {...} Already existing
["input"]=>
&object;(CI_Input)#7 (4) {...} Already existing
["benchmark"]=>
&object;(CI_Benchmark)#1 (1) {...} Already existing
["uri"]=>
&object;(CI_URI)#8 (2) { Already existing
["router"]=>
&object;(CI_Router)#5 (12) { Already existing
["config"]=>
&object;(CI_Config)#3 (2) {...} ...
...}
["output"]=>
&object;(CI_Output)#6 (4) {...}
["lang"]=>
&object;(MY_Language)#9 (3) {...}
["load"]=>
&object;(CI_Loader)#11 (11) {...}
["db"]=>
&object;(CI_DB_mysqli_driver)#12 (27) {...}
["session"]=>
&object;(CI_Session)#14 (9) {...}
["calendar"]=>
&object;(MY_Calendar)#16 (9) {...}
["layout"]=>
&object;(Layout)#18 (1) {...}
["page"]=>
&object;(Page)#17 (11) {...}
["blog"]=>
&object;(Blog_model)#21 (16) {...} What the hell? A Blog_model inside the Blog_model? Phew! :gulp:
...

Any ideas?

UPDATE:
Under the shower it occurred to me, are they references? This is what I meant with "several times nested data: array(Config, Router => array(Config, []), Blog_model => array(Blog_model, []), []). okay?


Messages In This Thread
Class referencing appears a memory leak - by El Forum - 10-31-2007, 10:53 AM
Class referencing appears a memory leak - by El Forum - 10-31-2007, 11:23 AM
Class referencing appears a memory leak - by El Forum - 10-31-2007, 11:37 AM
Class referencing appears a memory leak - by El Forum - 10-31-2007, 11:53 AM
Class referencing appears a memory leak - by El Forum - 10-31-2007, 12:15 PM
Class referencing appears a memory leak - by El Forum - 10-31-2007, 12:34 PM
Class referencing appears a memory leak - by El Forum - 11-01-2007, 01:20 AM
Class referencing appears a memory leak - by El Forum - 11-01-2007, 02:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB