LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-25-2014, 07:09 PM   #1
bzsurr
LQ Newbie
 
Registered: Sep 2014
Posts: 2

Rep: Reputation: Disabled
Cannot allocate memory


Hi there,

I am running a Debian (Linux 3.2.41) Server. I noticed several times that the allocation of memory failed. For example I get errors like "fork: Cannot allocate memory". But since according to htop only 781MB of 2GB are used I found it could have something to do with the settings. I ran
Code:
ulimit -a
which gives me this

Code:
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 127259
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 127259
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
Executing free gives me:
Code:
             total       used       free     shared    buffers     cached
Mem:       2097152     891348    1205804          0          0      91716
-/+ buffers/cache:     799632    1297520
Swap:            0          0          0
But I have no clue what this tells me. Can anybody help me please?

Best regards

Last edited by bzsurr; 09-25-2014 at 07:34 PM.
 
Old 09-26-2014, 12:24 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
It could be your overcommit settings are too strict. Check the following:

Code:
grep Committed_AS /proc/meminfo

cat /proc/sys/vm/overcommit_memory

cat /proc/sys/vm/overcommit_ratio
 
Old 09-26-2014, 02:58 PM   #3
bzsurr
LQ Newbie
 
Registered: Sep 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you for your answer.

Code:
grep Committed_AS /proc/meminfo
outputs nothing

cat /proc/sys/vm/overcommit_memory 
outputs 0

cat /proc/sys/vm/overcommit_ratio
outputs 50
What does this mean?
 
Old 09-26-2014, 07:06 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by bzsurr View Post
What does this mean?
Mainly it means my guess was wrong.

I don't know why there is no Committed_AS entry in /proc/meminfo, but that was only secondary info that might have mattered if the other two had unusual values.

Those typical values for overcommit settings ought to mean overcommit limits are not the problem.

I always configure some swap space so there is more margin of error on overcommit and related issues. But you seem to have enough free memory that lack of swap space should not explain the problem.
 
Old 09-26-2014, 08:45 PM   #5
bitsource
LQ Newbie
 
Registered: Sep 2014
Location: Guthrie, OK
Distribution: Ubuntu 14.04 , openSUSE 13.1
Posts: 10

Rep: Reputation: Disabled
What's throwing the error? If it's the kernel try running memtest -- might be hardware.
 
Old 09-27-2014, 01:12 AM   #6
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
Include the complete backtrace/stacktrace for us to review.

What does 'cat /proc/buddyinfo' return?
 
  


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
[SOLVED] how to allocate dynamic memory to shared memory golden_boy615 Programming 7 04-25-2018 02:34 PM
SOLVED: virtual memory exhausted: Cannot allocate memory tonj Linux - Newbie 6 06-12-2014 07:27 AM
[SOLVED] error while compiling llvm : virtual memory exhausted: Cannot allocate memory aashayshah Linux From Scratch 5 03-13-2013 10:04 AM
Cannot allocate memory sha_neb Linux - Software 1 05-03-2011 05:22 PM
Cannot allocate memory Terroth Linux - General 13 02-09-2005 05:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:59 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