Jump to content

why would I get "out of memory" warnings when I load page? what things to avoid?


Recommended Posts

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...

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.

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!

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.