jeffjohnvol Posted July 20, 2009 Share Posted July 20, 2009 I searched for this, but the search daemon couldn't be reached.... I am using a Drupal CMS, which allows the addition of "modules" Each module that gets activated requires more memory to be allocated as it pulls up the "modules" page, eventually giving a memory allocation error. I am suspecting that some "modules" require more memory than others, and there may be one that is using way too much. Is there a way to track how much memory has been allocated (or likewise, how much is still available) while a page is being generated in PHP? Something I could output to a table, file or screen? Link to comment https://forums.phpfreaks.com/topic/166619-how-to-track-memory-allocation/ Share on other sites More sharing options...
patrickmvi Posted July 20, 2009 Share Posted July 20, 2009 This may be what you're looking for: http://www.php.net/memory_get_usage Link to comment https://forums.phpfreaks.com/topic/166619-how-to-track-memory-allocation/#findComment-878590 Share on other sites More sharing options...
Daniel0 Posted July 20, 2009 Share Posted July 20, 2009 Run it through a profiler/debugger. Link to comment https://forums.phpfreaks.com/topic/166619-how-to-track-memory-allocation/#findComment-878593 Share on other sites More sharing options...
jeffjohnvol Posted July 20, 2009 Author Share Posted July 20, 2009 This may be what you're looking for: http://www.php.net/memory_get_usage Beautiful, this is what I need. Thanks! Link to comment https://forums.phpfreaks.com/topic/166619-how-to-track-memory-allocation/#findComment-878597 Share on other sites More sharing options...
jeffjohnvol Posted July 20, 2009 Author Share Posted July 20, 2009 Run it through a profiler/debugger. I think patrickvmi post may do what i need, but if it doesn't, is there one you recommend. I should say that this is a hosted solution through 1and1.com, so I may not be able to run a tool like that. I would have bumped up my memory allocation to 64 MB if I did have the access. I'm limited to 40MB as it is. Thanks! Link to comment https://forums.phpfreaks.com/topic/166619-how-to-track-memory-allocation/#findComment-878599 Share on other sites More sharing options...
Daniel0 Posted July 20, 2009 Share Posted July 20, 2009 Is there any reason you couldn't profile it and debug it on your local computer? The only PHP debugger/profiler I've ever used was the one in Zend Studio, but you can obviously find other free ones as well. Link to comment https://forums.phpfreaks.com/topic/166619-how-to-track-memory-allocation/#findComment-878607 Share on other sites More sharing options...
jeffjohnvol Posted July 20, 2009 Author Share Posted July 20, 2009 Is there any reason you couldn't profile it and debug it on your local computer? The only PHP debugger/profiler I've ever used was the one in Zend Studio, but you can obviously find other free ones as well. Good point. If it comes down to that, that would be a good solution. I would have to get apache on my pc (obviously) as well as the rest of the site. Link to comment https://forums.phpfreaks.com/topic/166619-how-to-track-memory-allocation/#findComment-878610 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.