Out of memory! Message in Error Log

postcd

Well-Known Member
Oct 22, 2010
721
20
68
/usr/local/cpanel/logs/error_log
ha slines like:
Out of memory!
Out of memory!
Out of memory!
Out of memory!
Out of memory!
Out of memory!
Duplicate logaccess: at cpsrvd-ssl line 3561
cpanel::cpsrvd::logaccess() called at cpsrvd-ssl line 3835
cpanel::cpsrvd::do_token_passthrough(__CPANEL_HIDDEN__, __CPANEL_HIDDEN__, __CPANEL_HIDDEN__) called at cpsrvd-ssl line 5736
cpanel::cpsrvd::handle_form_login() called at cpsrvd-ssl line 1287
cpanel::cpsrvd::handle_one_connection() called at cpsrvd-ssl line 1149
cpanel::cpsrvd::script() called at cpsrvd-ssl line 435
Out of memory!
Out of memory!
Out of memory!
Out of memory!
Out of memory!
Please any advice on what to do to fix?


my max cpanel process memory is: 512Mb

One user reports, that he sees blank page after cpanel account login screen..

----
i temporarilly fixed this by restarting mysqld,
in my case i seen by top and htop that mysql processes taking alot of memory, exhausting available mem for my server. after restart account is accessible again (blank page away). I also increased "max cpanel process memory" from 512 to 1024 from within WHM / Server Configuration/ Tweak settings.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Hello :)

I am happy to see you were able to address the issue. Thank you for updating us with the outcome.
 

HostCenter IL

Active Member
PartnerNOC
Nov 22, 2011
31
0
56
cPanel Access Level
Root Administrator
I just had the same problem. Is there any way to fix it other than restarting MySQL? (This is not a really good idea on a shared hosting server.)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
I just had the same problem. Is there any way to fix it other than restarting MySQL? (This is not a really good idea on a shared hosting server.)
Are you taking a specific action when you notice the "Out of Memory" message in the cPanel error log? Have you tried increasing the value for "Max cPanel process memory" in "Tweak Settings"?

Thank you.
 
Nov 13, 2007
11
1
53
This issue began for me back in June. The way I fixed the issue is I added more swap (was 1GB, now 3GB). My question is why all of a sudden did cpanel functions (update, backup, etc...) begin (and continues) to consume a great deal of memory?

The reason I ask is I feel that cpanel is consuming so much memory that it is taking away from the normal daily operation. For example, I can reboot my server and during the day I will be using about half of my 3.4GB physical memory with MySql utilizing about 14% and no swap being used. After/during cpanel cron runs the update, bincheck, or backup, all of my physical memory is consumed and swap has to be utilized. Also MySql memory drops to about 11%.

At the time I did open a support ticket but the response was try this or that. Instead of suggesting "this or that" why not find out the cause and fix it?

Before this all occurred, my backups used to take no longer than 30 minutes and now they take almost 3 hours.

Attached is a graph of the last 24 hours and last 7 days that show the spike in memory everyday that cpanel cron occurs.
 

Attachments

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Please ensure you read the following post to fully understand how memory usage works:

Memory Usage Higher Than Expected

That's not to say your memory usage is normal, especially with SWAP usage, but it's import to post that link for others that may see this thread.

Before this all occurred, my backups used to take no longer than 30 minutes and now they take almost 3 hours.
Feel free to open a support ticket if you want us take a closer look at the backup generations on your system to see if we notice anything out of the ordinary. You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 
Nov 13, 2007
11
1
53
Thanks for the reply Michael. Yes, I have read that post numerous times and I still do not fully understand how memory works. To tell you the truth, I cannot even see the excessive memory usage in top when it occurs but I can certainly see it in the graphs. I just wanted to post how I remedied (not "fix" as I stated before) the issue so others would know.

I did not get anywhere with the ticket I submitted so I am not sure I want to revisit it. All I know is that there is excessive memory usage when cpanel runs any type of function. It seems to me that it is using very little CPU thus putting a strain on memory usage.?

The spikes you see in the above graphs are only from cpanel updates. I ended up doing backups once a week instead of the usual every other day because it was interfering with other crons that I have set up to run in the middle of the night. I am going to turn off updates and backups for a while and see what the results are.

- - - Updated - - -

I meant to post this in my previous post but it appears that I am unable to edit my posts. Here is my current memory usage.

Current Memory Usage

Code:
             total       used       free     shared    buffers     cached
Mem:       3572736    3070692     502044          0          0    2001520
-/+ buffers/cache:    1069172    2503564
Swap:      3572736     192512    3380224
Total:     7145472    3263204    3882268
 
Nov 13, 2007
11
1
53
Well unfortunately there is no way to completely disable cpanel updates. The update check still runs and still consumes a great amount of memory.

So again, my question is why does cpanel consume so much memory? It did not used to and even the documentation still states that the default cpanel max memory is 128MB. https://documentation.cpanel.net/display/1144Docs/Tweak+Settings

Max cPanel process memory

This item allows you to specify the maximum amount of memory a cPanel process is able to use before it is automatically killed.

To specify a new value, click the button that corresponds to the available text box and enter the value you wish to use.

This item defaults to 128 MB.
You may also select Unlimited if you do not want to impose a memory limit on cPanel processes.
Good luck trying to change this value lower than 512MB because it will not allow you to. What I don't understand is cpanel is obviously using more than 512MB of memory so why are the processes not being killed?

So as it stands currently, you need at least 1GB of memory just for cpanel use. If I want to keep my performance up I will need to add more memory.

{sarcasm}Thanks CPanel!{/sarcasm}
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
I did not get anywhere with the ticket I submitted so I am not sure I want to revisit it. All I know is that there is excessive memory usage when cpanel runs any type of function. It seems to me that it is using very little CPU thus putting a strain on memory usage.?
Could you let us know the ticket number so we can take a closer look?

Thank you.
 
Nov 13, 2007
11
1
53
Support Request Id 5202305 - Cron Backups

The subjuect is Cron Backups but that was before I realized it was updates that was causing high memory usage as well.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Hello :)

Just to clarify, are you experiencing actual performance issues (e.g. websites down, slowness), or is it just the statistics that show memory is utilized that concerns you?

Thank you.
 
Nov 13, 2007
11
1
53
Performance (slowness, responsiveness). I can reboot the server and my websites will run great all day long but after updates/backups run, my sites become slow. It would also be nice if my backups only took 30 minutes to backup like they used to instead of 3 hours.

- - - Updated - - -

Why can't anyone explain why cPanel utilizes at least 1GB of memory?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Why can't anyone explain why cPanel utilizes at least 1GB of memory?
Essentially, what you are saying is that the cPanel memory limit for cPanel-related processes is not being properly enforced, and that cPanel is using more memory than it should. It's not something we can answer because it's not something that's been reported or is a known issue. This would be something that we would have to look into by examining your server. You would have to open a support ticket so we can take a closer look, as it was not brought up in the previous ticket you referenced.

Thank you.