Veronique,

  I just executed your code sample and received
  before : 262144 bytes
  after  : 786432 bytes
  
  Kinda interesting, Zend_Db_Adapter_Pdo_Mysql
  class instantiating doesn't change memory consumption ...
  Having just <?php 'require_once 'Zend/Db/Adapter/Pdo/Mysql.php'; ?>
  brings memory usage to the same 786432 bytes.

  
  PS: PHP 5.2.1 (cli), Zend Framework 1.0.2
  
-- 
Best regards,
Andrew Bidochko
Software Engineer/Architect
Mashup Technologies
http://MashupTechnologies.com

Monday, November 5, 2007, 4:15:53 PM, you wrote:


V> Hi Darby,

V> Here is the phpInfo I included via the nabble forum (hope it goes through
V> ok), for our development server: 
V> http://www.nabble.com/file/p13596801/phpinfo.html phpinfo.html 

V> I'll add that I did some more testing, this time with the memory_get_usage()
V> parameter set to "true" (to show real usage), and... well, just doing this
V> (replaced the username/pass etc. of course):


V> <?php
V> echo 'before : ' . memory_get_usage(true) . '<br />';

V> function __autoload($class_name) {
V>    Zend_Loader::loadClass($class_name);
V> }

V> require_once 'Zend/Loader.php';

V> $config = array('host'=>'localhost', 'username'=>'USER', 'password'=>'PASS',
'dbname'=>>'DBNAME');
V> $adapter = new Zend_Db_Adapter_Pdo_Mysql($config);
V> echo 'after : ' . memory_get_usage(true) . '<br />';


V> My output:

V> before : 262144
V> after : 1310720

V> 1310720 bytes is exactly 1.25 mb, and so instantiating the class used
V> exactly 1 meg (1048576 bytes of difference).  With the parameter set to
V> false, I get this output:

V> before : 86512
V> after : 1081512

V> Perhaps I'm out of touch and this sort of memory usage is normal from using
V> a framework, but I have a feeling this is just way too much for just
V> instantiating one simple database adapter object. Then again I haven't
V> really seen anyone complaining about the memory usage, so I wonder if we are
V> the only ones who are concerned about this (since we plan on using the Zend
V> Framework on very high-traffic websites) or if we are doing something wrong
V> or what.

V> Thanks for any help,
V> Veronique


V> Darby Felton wrote:
>> 
>> Hi Veronique,
>> 
>> What extensions is PHP loading? Can we see phpinfo()?
>> 
>> Best regards,
>> Darby
>> 
>> Veronique wrote:
>>> Hello Tobias,
>>> 
>>> Sorry about that, I should have been more specific. We do use Linux
>>> (Gentoo), PHP version 5.2.1. with Zend Optimizer, Apache version 2.0.58
>>> on
>>> our development server.
>>> So yeah, I'm a bit at a loss here...
>>> 
>>> Thanks,
>>> Veronique
>>> 
>>> 
>>> Tobias Gies wrote:
>>>> Hey Veronique,
>>>>
>>>> Do you use a windows version or a linux version of PHP? If you use a
>>>> windows version, please try again with linux; I made the experience that
>>>> PHP under windows generally is a memory whore.
>>>>
>>>> Best regards,
>>>> Tobias
>>>>
>>>> Veronique schrieb:
>>>>> Hello,
>>>>>
>>>>> We have been using the Zend Framework for our projects at my job, and
>>>>> only
>>>>> recently (after months of development of course ;)) have we noticed
>>>>> that
>>>>> various components of the Zend Framework uses a lot more memory than we
>>>>> find
>>>>> normal.
>>>>> For example, according to the traces we left (using PHP's
>>>>> memory_get_usage()
>>>>> directly), calling the Zend_Db Factory uses between 700 kb and 1 meg,
>>>>> and
>>>>> merely instantiating the controller front used 1+ meg! 
>>>>>
>>>>> Is it just me or is that a lot of overheard? We are pretty much in
>>>>> trouble
>>>>> since we are planning to use the framework on very high-traffic
>>>>> websites,
>>>>> and some of our pages can go up to 5-6 megs of memory usage in total.
>>>>>
>>>>> Any ideas or suggestions? We can always try to optimize a few things,
>>>>> but
>>>>> I'm still at a loss as to why using the Zend components like the DB
>>>>> adapters
>>>>> and the Zend_Controller_Front take up so much memory...
>>>>>   
>>>>
>>>>
>>> 
>> 
>> 




Reply via email to