Running out of memory, fork can't allocate memory
up vote
1
down vote
favorite
We are getting out of memory frequently, as well fork cannot allocate memory. I did some investigation.
It seems that scripts are not case as I thought before this. I will share information which I get after analyzing.
I have isolated server, so other people cant reach to server. This will show "true" memory usage in this case.
- I have no mysqld and apache started [memory usage ~182mb].
- just started mysqld. no connections made to mysqld [mu ~340mb].
- httpd started [~360mb].
- first request to script. [~630mb]. But!! The most interesting part. Memory doesn't get deallocated. Everything looks OK. Script ended, page loaded successfuly. But it still around ~630mb.
Why one request eats 270MB? Why thats not deallocated after request?
Some stats:
- Server RAM 512 MB guaranteed
- 256 MB burstable
- PHP memory limit: 256MB
httpd.conf
<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 3
ServerLimit 50
MaxClients 50
MaxRequestsPerChild 50
</IfModule>
linux memory apache-http-server php
add a comment |
up vote
1
down vote
favorite
We are getting out of memory frequently, as well fork cannot allocate memory. I did some investigation.
It seems that scripts are not case as I thought before this. I will share information which I get after analyzing.
I have isolated server, so other people cant reach to server. This will show "true" memory usage in this case.
- I have no mysqld and apache started [memory usage ~182mb].
- just started mysqld. no connections made to mysqld [mu ~340mb].
- httpd started [~360mb].
- first request to script. [~630mb]. But!! The most interesting part. Memory doesn't get deallocated. Everything looks OK. Script ended, page loaded successfuly. But it still around ~630mb.
Why one request eats 270MB? Why thats not deallocated after request?
Some stats:
- Server RAM 512 MB guaranteed
- 256 MB burstable
- PHP memory limit: 256MB
httpd.conf
<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 3
ServerLimit 50
MaxClients 50
MaxRequestsPerChild 50
</IfModule>
linux memory apache-http-server php
1
What else is started? ~180MiB RAM after boot into headless system sounds unreasonable. Also, what does that script do? How big is the database backing it up?
– Bobby
Mar 21 '12 at 13:14
What is exactly "memory usage"? How did you measure it? Is it the one from the first line offree
?
– Cristian Ciupitu
Mar 21 '12 at 13:58
Bobby, this is "ps faux" pastebin.com/4yKGBTyj
– Toktik
Mar 21 '12 at 15:39
Cristian, yes, it is from "free" command, also from mediatemple server status, which is the same. Also "cat /proc/user_beancounters" pastebin.com/H9FZkFWj
– Toktik
Mar 21 '12 at 15:39
Looks to me like a bulk of it is going to httpd.
– JeffG
Mar 22 '12 at 1:41
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
We are getting out of memory frequently, as well fork cannot allocate memory. I did some investigation.
It seems that scripts are not case as I thought before this. I will share information which I get after analyzing.
I have isolated server, so other people cant reach to server. This will show "true" memory usage in this case.
- I have no mysqld and apache started [memory usage ~182mb].
- just started mysqld. no connections made to mysqld [mu ~340mb].
- httpd started [~360mb].
- first request to script. [~630mb]. But!! The most interesting part. Memory doesn't get deallocated. Everything looks OK. Script ended, page loaded successfuly. But it still around ~630mb.
Why one request eats 270MB? Why thats not deallocated after request?
Some stats:
- Server RAM 512 MB guaranteed
- 256 MB burstable
- PHP memory limit: 256MB
httpd.conf
<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 3
ServerLimit 50
MaxClients 50
MaxRequestsPerChild 50
</IfModule>
linux memory apache-http-server php
We are getting out of memory frequently, as well fork cannot allocate memory. I did some investigation.
It seems that scripts are not case as I thought before this. I will share information which I get after analyzing.
I have isolated server, so other people cant reach to server. This will show "true" memory usage in this case.
- I have no mysqld and apache started [memory usage ~182mb].
- just started mysqld. no connections made to mysqld [mu ~340mb].
- httpd started [~360mb].
- first request to script. [~630mb]. But!! The most interesting part. Memory doesn't get deallocated. Everything looks OK. Script ended, page loaded successfuly. But it still around ~630mb.
Why one request eats 270MB? Why thats not deallocated after request?
Some stats:
- Server RAM 512 MB guaranteed
- 256 MB burstable
- PHP memory limit: 256MB
httpd.conf
<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 3
ServerLimit 50
MaxClients 50
MaxRequestsPerChild 50
</IfModule>
linux memory apache-http-server php
linux memory apache-http-server php
edited Mar 21 '12 at 13:36
slhck
158k46434461
158k46434461
asked Mar 21 '12 at 12:26
Toktik
10914
10914
1
What else is started? ~180MiB RAM after boot into headless system sounds unreasonable. Also, what does that script do? How big is the database backing it up?
– Bobby
Mar 21 '12 at 13:14
What is exactly "memory usage"? How did you measure it? Is it the one from the first line offree
?
– Cristian Ciupitu
Mar 21 '12 at 13:58
Bobby, this is "ps faux" pastebin.com/4yKGBTyj
– Toktik
Mar 21 '12 at 15:39
Cristian, yes, it is from "free" command, also from mediatemple server status, which is the same. Also "cat /proc/user_beancounters" pastebin.com/H9FZkFWj
– Toktik
Mar 21 '12 at 15:39
Looks to me like a bulk of it is going to httpd.
– JeffG
Mar 22 '12 at 1:41
add a comment |
1
What else is started? ~180MiB RAM after boot into headless system sounds unreasonable. Also, what does that script do? How big is the database backing it up?
– Bobby
Mar 21 '12 at 13:14
What is exactly "memory usage"? How did you measure it? Is it the one from the first line offree
?
– Cristian Ciupitu
Mar 21 '12 at 13:58
Bobby, this is "ps faux" pastebin.com/4yKGBTyj
– Toktik
Mar 21 '12 at 15:39
Cristian, yes, it is from "free" command, also from mediatemple server status, which is the same. Also "cat /proc/user_beancounters" pastebin.com/H9FZkFWj
– Toktik
Mar 21 '12 at 15:39
Looks to me like a bulk of it is going to httpd.
– JeffG
Mar 22 '12 at 1:41
1
1
What else is started? ~180MiB RAM after boot into headless system sounds unreasonable. Also, what does that script do? How big is the database backing it up?
– Bobby
Mar 21 '12 at 13:14
What else is started? ~180MiB RAM after boot into headless system sounds unreasonable. Also, what does that script do? How big is the database backing it up?
– Bobby
Mar 21 '12 at 13:14
What is exactly "memory usage"? How did you measure it? Is it the one from the first line of
free
?– Cristian Ciupitu
Mar 21 '12 at 13:58
What is exactly "memory usage"? How did you measure it? Is it the one from the first line of
free
?– Cristian Ciupitu
Mar 21 '12 at 13:58
Bobby, this is "ps faux" pastebin.com/4yKGBTyj
– Toktik
Mar 21 '12 at 15:39
Bobby, this is "ps faux" pastebin.com/4yKGBTyj
– Toktik
Mar 21 '12 at 15:39
Cristian, yes, it is from "free" command, also from mediatemple server status, which is the same. Also "cat /proc/user_beancounters" pastebin.com/H9FZkFWj
– Toktik
Mar 21 '12 at 15:39
Cristian, yes, it is from "free" command, also from mediatemple server status, which is the same. Also "cat /proc/user_beancounters" pastebin.com/H9FZkFWj
– Toktik
Mar 21 '12 at 15:39
Looks to me like a bulk of it is going to httpd.
– JeffG
Mar 22 '12 at 1:41
Looks to me like a bulk of it is going to httpd.
– JeffG
Mar 22 '12 at 1:41
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Why one request eats 270MB?
Likely because it accessed a lot of data or metadata in or about files on disk.
Why thats not deallocated after request?
Because the data might be used again soon. Deallocating it after the request makes the next request expensive. It makes more sense to defer the deallocation until the memory is actually needed for something else.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Why one request eats 270MB?
Likely because it accessed a lot of data or metadata in or about files on disk.
Why thats not deallocated after request?
Because the data might be used again soon. Deallocating it after the request makes the next request expensive. It makes more sense to defer the deallocation until the memory is actually needed for something else.
add a comment |
up vote
0
down vote
Why one request eats 270MB?
Likely because it accessed a lot of data or metadata in or about files on disk.
Why thats not deallocated after request?
Because the data might be used again soon. Deallocating it after the request makes the next request expensive. It makes more sense to defer the deallocation until the memory is actually needed for something else.
add a comment |
up vote
0
down vote
up vote
0
down vote
Why one request eats 270MB?
Likely because it accessed a lot of data or metadata in or about files on disk.
Why thats not deallocated after request?
Because the data might be used again soon. Deallocating it after the request makes the next request expensive. It makes more sense to defer the deallocation until the memory is actually needed for something else.
Why one request eats 270MB?
Likely because it accessed a lot of data or metadata in or about files on disk.
Why thats not deallocated after request?
Because the data might be used again soon. Deallocating it after the request makes the next request expensive. It makes more sense to defer the deallocation until the memory is actually needed for something else.
answered Oct 17 '17 at 6:31
David Schwartz
56.1k684128
56.1k684128
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f403211%2frunning-out-of-memory-fork-cant-allocate-memory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What else is started? ~180MiB RAM after boot into headless system sounds unreasonable. Also, what does that script do? How big is the database backing it up?
– Bobby
Mar 21 '12 at 13:14
What is exactly "memory usage"? How did you measure it? Is it the one from the first line of
free
?– Cristian Ciupitu
Mar 21 '12 at 13:58
Bobby, this is "ps faux" pastebin.com/4yKGBTyj
– Toktik
Mar 21 '12 at 15:39
Cristian, yes, it is from "free" command, also from mediatemple server status, which is the same. Also "cat /proc/user_beancounters" pastebin.com/H9FZkFWj
– Toktik
Mar 21 '12 at 15:39
Looks to me like a bulk of it is going to httpd.
– JeffG
Mar 22 '12 at 1:41