public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Axel Freyn <axel-freyn@gmx.de>
To: gcc-help@gcc.gnu.org
Subject: Re: RE: cannot run many programs simultaneously
Date: Thu, 04 Mar 2010 16:58:00 -0000	[thread overview]
Message-ID: <20100304165831.GN7759@axel> (raw)
In-Reply-To: <f637a789f917.4b8ff691@ucy.ac.cy>

Hi Anna,
On Thu, Mar 04, 2010 at 06:06:09PM +0200, Anna Sidera wrote:
> I am sending you the output of the top command when I run the program only one time.
> 
> top - 17:58:23 up 8 days,  2:45,  1 user,  load average: 1.00, 1.00, 1.00
> Tasks: 120 total,   2 running, 118 sleeping,   0 stopped,   0 zombie
> Cpu(s): 36.6%us,  0.1%sy,  0.0%ni, 63.4%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
> Mem:  10267424k total,  2039184k used,  8228240k free,   153588k buffers
> Swap:  2963952k total,    35404k used,  2928548k free,   104768k cached
This part means, you have a total of 10GB Ram + 2.9GB swap-space on the
disk, so you can use at the same time up to 13GB.
In addition: From the 10.2GB of Ram, 8.2GB are completely free at the
moment. From the 3GB of Swap-space on the disk, only 35MB are used.
> 
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> 23308 sidera    20   0 8809m 1.5g  720 R  101 15.8 592:06.37 fir2p
> 
> I think this means that the system has 10 GB RAM and 2 GB memory that
> can be used on the disk. In this case, the program asked for 8809 MB
> of RAM? How much memory is the program currently using? 
Yes, the program allocated (using "alloc" oder "new" or a similar
function) 8.8GB of memory. At the moment, it is using 1.5GB - the
remaining part of the allocated memory (8.8GB-1.5GB=7.3GB) is not used
by the program until now.
> How many of these programs should I be able to run simulatneously?

That is an answer nobody of us can answer;-)

To be on the safe side: IF the program is going to use ALL of these 8.8
GB - you can only run one program at a time (already two simultaneous
programs would need 2*8.8GB = 17.6GB, which is more than you have).

However: Nobody can say for sure whether that will happen or not: if the
program never uses more than 1.5GB, you can run up to 13GB/1.5GB = 8
programs simultaneously (well, maybe 7 as you also have other programs
needing memory).

In addition, there is of course a third possibility: maybe the program
is going to allocate even more memory - and also going to use it. Than
it might happen, that even the single run will crash if it runs to long. 

So, the safest solution would be to read the documentation / sourcecode
of the program in order to determine how much memory it is expected to
use:-)

HTH,

Axel

  reply	other threads:[~2010-03-04 16:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 14:35 Anna Sidera
2010-03-03 15:48 ` Ian Lance Taylor
2010-03-03 17:35 ` John S. Fine
2010-03-04  2:28   ` Anna Sidera
2010-03-04  3:34     ` John (Eljay) Love-Jensen
2010-03-04 16:09       ` Anna Sidera
2010-03-04 16:58         ` Axel Freyn [this message]
2010-03-04 16:43     ` John S. Fine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100304165831.GN7759@axel \
    --to=axel-freyn@gmx.de \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).