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? Quote 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 Quote 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. Quote 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! Quote 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! Quote 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. Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.