From: Roger R. <rog...@as...> - 2002-12-11 08:04:26
|
Hello Dev Team, This is my first post so please don't yell at me for mentioning something that has been mentioned before or for posting something that may not be appropriate for this list. I am a regular poster to PostNuke and Xaraya Dev lists and only want to better my Module :) Also, I understand that you're taking over the development of Cal-Zone (or at least have adopted that project as your own) so this may help that project in the future as well. I fully support Cal-Zone and have had many great conversations with Craig during its development. I feel it's a wonderful calendar and wish it much success. I also hope to learn from any advances You make with it as I hope my advances will help you. That said, on with the post : I develop the PostCalendar module and one particular beta tester keeps reporting the following: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 46080 bytes) in /home/testsite/htdocs/modules/PostCalendar/XXXXXXX on line XXX I've done everything I can to limit the amount of Memory my calendar uses and have not received any reports from users of PostNuke that memory problems Exist. One of the things I have done to alleviate the memory stress was to instantiate my pcSmarty class by reference using $tpl =& new pcSmarty throughout my code. I am thinking that it might be possible to alleviate more memory usage problems by having your eNvolution code also instantiate Smarty using references. This will allow the code to use the Smarty class as a reference rather than making a COPY of Smarty. Smarty is written in such a way that creating a new object by reference should not cause any problems as the Smarty doc itself says "If you need to create more than one Smarty object, then you're not using Smarty correctly." I've noticed that the class is instantiated a number of times throughout the code all using $foo = new Smarty; Using $foo =& new Smarty will most likely help with the problem I described above regarding memory usage. I took my local copy of eNvolution 1.1.0 that i use to test the PostCalendar code and found all the instances where smarty was instantiated and changed those instances to use references. From what I can tell, no adverse affects became of it. also... you can reference this document at the main php site for more information on references http://www.php.net/manual/en/language.references.whatdo.php Anyway - I'd love to hear your thoughts on it as you're the core devs of eNvolution and have much more knowledge of the code base at this time than I do. I'd also like to say that your work has been wonderful and has made the PostNuke and Xaraya teams FINALLY realize how important layout is. Keep up the good work and keep pushing the threshold. I wish you all the best in your future coding endeavors. Thanks, Roger Raymond PostCalendar Dev |