LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-02-2012, 01:58 AM   #1
wastingtime
Member
 
Registered: Sep 2004
Posts: 86

Rep: Reputation: 17
how does ulimit work


$ ulimit -m 150000 -v 500000
$ /usr/lib/thunderbird-9.0/thunderbird-bin

However

$ top
top - 23:46:50 up 4 days, 9:17, 6 users, load average: 0.33, 0.40, 0.43
Tasks: 129 total, 1 running, 128 sleeping, 0 stopped, 0 zombie
Cpu(s): 10.2%us, 2.8%sy, 0.0%ni, 87.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1024220k total, 920192k used, 104028k free, 4176k buffers
Swap: 2096444k total, 0k used, 2096444k free, 385832k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10545 user 1 0 475m 154m 31m S 0.0 15.4 0:30.89 firefox
9183 user 1 0 463m 168m 19m S 0.0 16.9 1:43.64 thunderbird-bin

How come thunderhog consumes more resident memory that ulimit allows?
 
Old 02-02-2012, 04:30 AM   #2
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 105Reputation: 105
man ulimit


Quote:
DESCRIPTION
The ulimit utility shall set or report the file-size writing limit
imposed on files written by the shell and its child processes (files of
any size may be read). Only a process with appropriate privileges can
increase the limit.


------------------------------------------------------

APPLICATION USAGE
Since ulimit affects the current shell execution environment, it is
always provided as a shell regular built-in. If it is called in a sepa‐
rate utility execution environment, such as one of the following:

nohup ulimit -f 10000
env ulimit 10000

it does not affect the file size limit of the caller's environment.




 
Old 02-02-2012, 05:46 AM   #3
wastingtime
Member
 
Registered: Sep 2004
Posts: 86

Original Poster
Rep: Reputation: 17
Yeah, I know about man ulimit.

How come thunderbird consumes more resident memory than what ulimit allows?
 
Old 02-03-2012, 04:34 AM   #4
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 105Reputation: 105
I just ran the same test on my system and thunderbird crashed because of lack of memmory. It appears to need it.

If you were doing all in the same shell I can only guess it is a permission issue.

Code:
[joe@Tux-Box ~]$ thunderbird 
Xlib:  extension "RANDR" missing on display ":0.0".
ReminderFox  clh(1)  {rmFx_cmdLine: [xpconnect wrapped nsICommandLine]}
out of memory
Segmentation fault
 
Old 02-03-2012, 09:35 AM   #5
wastingtime
Member
 
Registered: Sep 2004
Posts: 86

Original Poster
Rep: Reputation: 17
Yep, I speculate that ReimderFox extension, which I don't have installed, wants to gobble even more memory. This is so poorly designed it cannot handle out of memory error.

In your case ulimit seems to have done it's job though. My question is opposite: why thunderbird could allocate more memory that ulimit should have let it?
 
Old 10-22-2016, 10:26 PM   #6
mpb
LQ Newbie
 
Registered: Oct 2016
Posts: 3

Rep: Reputation: Disabled
Quote:
How come thunderhog consumes more resident memory that ulimit allows?
"ulimit -m" sets RLIMIT_RSS. Linux does not enforce RLIMIT_RSS.

From man setrlimit:

Code:
       RLIMIT_RSS
              Specifies  the  limit  (in  pages) of the process's resident set
              (the number of virtual pages resident in RAM).  This  limit  has
              effect only in Linux 2.4.x, x < 30, and there affects only calls
              to madvise(2) specifying MADV_WILLNEED.
Instead consider "ulimit -v" which sets RLIMIT_AS.

Code:
       RLIMIT_AS
              The maximum size of the process's virtual memory (address space)
              in bytes.  This limit  affects  calls  to  brk(2),  mmap(2)  and
              mremap(2),  which fail with the error ENOMEM upon exceeding this
              limit.  Also automatic stack expansion will fail (and generate a
              SIGSEGV  that  kills  the process if no alternate stack has been
              made available via sigaltstack(2)).  Since the value is a  long,
              on  machines  with  a 32-bit long either this limit is at most 2
              GiB, or this resource is unlimited.
Also, the man page for ulimit is not really relevant. It refers to the (obsolete?) ulimit "utility".

http://pubs.opengroup.org/onlinepubs...es/ulimit.html

The ulimit utility is not present on my Ubuntu Linux system. Instead, ulimit is typically a shell builtin command, and is documented in each shell's manpage.
 
  


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
ulimit -s 40960 vs ulimit ulimit -s 10240 centguy Linux - Software 2 10-22-2016 11:38 PM
Not enough memory for Posix message queues... ulimit -q doesnt work ?? marconap Linux - Newbie 1 02-22-2008 05:26 AM
ulimit spivy66 Linux - General 6 01-11-2008 01:33 PM
What is ulimit and what it does? brazilian_user Linux - General 3 01-30-2007 01:39 PM
Ulimit -v Help !!!!!!!!!!!!!!!!!!!!!! raees Linux - Software 1 07-04-2004 10:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:32 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
Open Source Consulting | Domain Registration