LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-17-2017, 11:59 PM   #1
DreadMaster
LQ Newbie
 
Registered: Oct 2017
Posts: 3

Rep: Reputation: Disabled
Question -bash: fork: Cannot allocate memory


Hello users of linuxquestions!

I have a problem that so far I am unable to solve.
For the lab tests I need to run about 3000 instances of a single daemon(yes!). The daemon does not consume much memory, about 20% when 2000 instances are present. However when I reach 3000 it just says -bash: fork: Cannot allocate memory. The memory aint a problem for the server it has 32gb ram.
ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 128338
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 100000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 128338
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

anyone has ideas on how to increase the quota of daemon instances?

Thank you!
 
Old 10-18-2017, 12:45 AM   #2
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,193

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
After starting the daemons, does
Code:
jobs
show them?
If yes they occupy resources in bash i.e. are not fully daemonized.
 
Old 10-18-2017, 01:14 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,083

Rep: Reputation: 4137Reputation: 4137Reputation: 4137Reputation: 4137Reputation: 4137Reputation: 4137Reputation: 4137Reputation: 4137Reputation: 4137Reputation: 4137Reputation: 4137
you may try to use strace to check what was the real problem.
 
Old 10-18-2017, 02:01 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 12,471
Blog Entries: 9

Rep: Reputation: 3377Reputation: 3377Reputation: 3377Reputation: 3377Reputation: 3377Reputation: 3377Reputation: 3377Reputation: 3377Reputation: 3377Reputation: 3377Reputation: 3377
Quote:
Originally Posted by MadeInGermany View Post
After starting the daemons, does
Code:
jobs
show them?
If yes they occupy resources in bash i.e. are not fully daemonized.
if this is true, then
Code:
yourcommandhere & disown
could help?
 
Old 10-18-2017, 02:17 AM   #5
DreadMaster
LQ Newbie
 
Registered: Oct 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
if this is true, then
Code:
yourcommandhere & disown
could help?
jobs return nothing, to spawn copies I am using something like this in python

def startDae(config_path):
CMD = "testlab05 -f %s" % config_path
print '\n[>]', CMD
os.system(CMD)

update:
looks like I can't run it fully in the background, after doing ./testlabs05 -f config.xml&
it does not fully go into the background and jobs -l still returns nothing.
is there a way to run it as a "full time" job in a background without actually making modifications to a code?

Last edited by DreadMaster; 10-18-2017 at 02:29 AM.
 
Old 10-18-2017, 02:25 AM   #6
!!!
Member
 
Registered: Jan 2017
Posts: 666

Rep: Reputation: 289Reputation: 289Reputation: 289
Welcome to LQ!!! Swap ok? Look into tools like:
free; htop; vmstat; tricky ps switches, smem ...
From this web-search: linux memory usage monitor per process details
(add Goo's intitle: or DDG's t: to memory; no space after colon)

Let us know... For a LinuxPHD, use sysdig.com
(Which distro? Is sysdig in your repos?)

Last edited by !!!; 10-18-2017 at 02:40 AM.
 
Old 10-18-2017, 02:45 AM   #7
!!!
Member
 
Registered: Jan 2017
Posts: 666

Rep: Reputation: 289Reputation: 289Reputation: 289
nohup? https://stackoverflow.com/questions/...r-i-logout-ssh
Idk; DDGoo sure does, given the 'right' keywords!!!

Last edited by !!!; 10-18-2017 at 02:49 AM.
 
Old 10-18-2017, 08:54 AM   #8
DreadMaster
LQ Newbie
 
Registered: Oct 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
its not the python script that needs the upkeep but to daemonise the process of a binary.
nohup and & doesn't help.
I am sorry that it has gone to this simpler matter, will welcome all the help!
Thank's ahead.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fork: Cannot allocate memory after each command postcd Linux - General 4 07-14-2016 07:56 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 - Server

All times are GMT -5. The time now is 05:55 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration