LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-10-2016, 03:18 AM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
fork: Cannot allocate memory after each command


Hello, this is an OpenVZ VPS with Debian Linux.

it is 128MB RAM and 256MB with burst. But after each command i see fork error. Can you please help to discover where the issue lies and how i can remove this error without upgrading RAM which seems to be alot of free? Thank You

Quote:
root@uanmoqfh # w
08:11:21 up 11:54, 0 users, load average: 0.01, 0.01, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
-bash: fork: Cannot allocate memory
root@uanmoqfh # free -mt
total used free shared buffers cached
Mem: 256 68 187 0 0 34
-/+ buffers/cache: 34 221
Swap: 256 8 247
Total: 512 76 435
-bash: fork: Cannot allocate memory
root@uanmoqfh # df -h
Filesystem Size Used Avail Use% Mounted on
/dev/simfs 4.9G 540M 4.4G 11% /
tmpfs 128M 0 128M 0% /lib/init/rw
tmpfs 128M 0 128M 0% /dev/shm
-bash: fork: Cannot allocate memory
 
Old 07-10-2016, 04:47 AM   #2
postcd
Member
 
Registered: Oct 2013
Posts: 527

Original Poster
Rep: Reputation: Disabled
I was adviced to check bean counters because im hitting some of the limits there:
cat /proc/user_beancounters
If yes, if there are fail counts (failcnt), then i need to ask my VPS provider to raise that limit.
 
Old 07-11-2016, 07:49 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
Yes, and also, there are only a very-few "official" return codes from fork. It is not entirely consistent how they are used, especially when (as in this case) an external throttling mechanism is being used. It could be argued that [EAGAIN] should have been returned, but you have no control over which one did get returned.

You should also keep in mind that it may or may not be bean_counters that is supplying the limit. There are several limiters out there, and this particular one has been "superseded" although this of course does not mean that it is no longer found to be in-service somewhere.
 
Old 07-11-2016, 09:38 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by sundialsvcs View Post
Yes, and also, there are only a very-few "official" return codes from fork. It is not entirely consistent how they are used, especially when (as in this case) an external throttling mechanism is being used. It could be argued that [EAGAIN] should have been returned, but you have no control over which one did get returned.

You should also keep in mind that it may or may not be bean_counters that is supplying the limit. There are several limiters out there, and this particular one has been "superseded" although this of course does not mean that it is no longer found to be in-service somewhere.
And the OP can also go back and check the OTHER three threads (going back to 2014), where "fork" is mentioned, and advice was given?

From May of this year:
http://www.linuxquestions.org/questi...ee-4175581011/

...which was marked "SOLVED", and also contains numerous references to other threads the OP opened about how to monitor memory/resources.

Or the duplicate threads from 2014:
http://www.linuxquestions.org/questi...er-4175494476/
http://www.linuxquestions.org/questi...er-4175494339/

...in which the same error message is given.

Last edited by TB0ne; 07-11-2016 at 09:40 AM.
 
Old 07-14-2016, 07:56 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Might check the contents of the bashrc file in use... I suspect this is a message being generated during the creation of the input prompt string.

I'm basing that on the sequence operations shown - the first prompt string looks normal (but were there any errors immediately before that?). The command itself worked just fine - which shows that fork/exec sequence is having no problems. THEN the error messages are shown. To me, that would imply that during the formatting of the PS1 string things get a bit bogus.

Last edited by jpollard; 07-14-2016 at 07:59 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "Unable to fork: Cannot allocate memory" even 10GB RAM free postcd Linux - General 10 06-05-2016 12:03 PM
vmware fork:cannot allocate memory muhui Linux - Virtualization and Cloud 2 03-01-2016 07:36 PM
Problem with GIMP: error "failed to fork - cannot allocate memory" heffo_j Linux - Software 5 05-24-2009 12:19 AM
-bash: fork: Cannot allocate memory jonnyhashem Fedora 1 02-20-2009 04:49 PM
"bash: fork: Cannot allocate memory" error guarriman Linux - General 1 04-05-2007 12:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration