Using the Autoload function shoudn't hit, because the class itself does not load until it is called or used. Autoload contruct basically loads the class as needed, they have not already been created.
Find the code in which the class was first created. If class files are not automatically triggered, it does not accept any memory. Perhaps not all of them were created, but they do not shut down when this is not necessary.
When you find where each of them was created, or the one you are talking about, you can use:
//Gets the object name using the class. echo get_class($classinstance) , "\n";
You can handle this by placing some breakpoints using memory_get_peak_usage() .
//Output memory usage at start of class instanciation. echo memory_get_usage()
Now try the same thing, but this time using unset () after using the class:
//Output memory usage at start of class instanciation. echo memory_get_usage()
So, basically in theory, disable any unused instance through the application, find large objects, debug.
This is @ explanation of general comments regarding OOP:
Take this piece as a sample:
class Tun{ private $run = 'i\'m running'; function run(){ echo $this->run; } } echo Tun::run;
Conclusion:
Error: Fatal error: Undefined class constant 'run' in C:\Work\pro\debug.php on line 16
The above example, since it refers to a function that uses OOP, in this case is a private variable of the $run class. Since the class is not created (an instance of the object), it will fail. So, yes, you can use functions within a class by reference, but they basically should be a simple procedural or permalink.
I hope for this help.