mac007 Posted July 14, 2009 Share Posted July 14, 2009 Hello, All: Sometimes I get this "Out of memory" warning when I load my page... this page has several recordsets that pull all kinds of records from a mysql-database. What would be the reasons I get this warning? or what steps should I take to avoid that from happening? could it be repetitive scripts? or repetitive connection calls?? Appreciate any help... Quote Link to comment https://forums.phpfreaks.com/topic/165949-why-would-i-get-out-of-memory-warnings-when-i-load-page-what-things-to-avoid/ Share on other sites More sharing options...
premiso Posted July 14, 2009 Share Posted July 14, 2009 A lot of times the out of memory can be caused by infinite loops. I would check any loops that you have. Also if you are reading/using images from the DB or inside the script, try and make that as efficient as possible as it can easily eat up memory. It is hard to really give you more detail of help without seeing any code as it could be how you coded it as well that is inefficient and eating up the memory. Quote Link to comment https://forums.phpfreaks.com/topic/165949-why-would-i-get-out-of-memory-warnings-when-i-load-page-what-things-to-avoid/#findComment-875243 Share on other sites More sharing options...
mac007 Posted July 14, 2009 Author Share Posted July 14, 2009 Thanks Premiso... Yeah, well, it's a very long page, so I just wanted overall guidance since not sure where to even begin... I'll check for loops... already found a repeating mysql_select_db line in there. Could it also be any of these: 1) that I been refreshing page over and over again as I make changes and test page... coudl it be that I keep calling the connection too many times? 2) my connection call is "permanent" (mysql_pconnect), and some of these recordsets I didnt "close" (mysql_free_result), coudl that be an issue?? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/165949-why-would-i-get-out-of-memory-warnings-when-i-load-page-what-things-to-avoid/#findComment-875253 Share on other sites More sharing options...
premiso Posted July 21, 2009 Share Posted July 21, 2009 1) that I been refreshing page over and over again as I make changes and test page... coudl it be that I keep calling the connection too many times? It could be, especially if using the persistant, not permanent, connection type. Is there any reason you are using that? 2) my connection call is "permanent" (mysql_pconnect), and some of these recordsets I didnt "close" (mysql_free_result), coudl that be an issue?? That could be causing it, but see my answer above, if you do not know why you are using it, chances are you do not need the pconnect, just use the regular mysql_connect function instead. Quote Link to comment https://forums.phpfreaks.com/topic/165949-why-would-i-get-out-of-memory-warnings-when-i-load-page-what-things-to-avoid/#findComment-879476 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.