* Re: Virtual memory exhausted
@ 2001-01-17 12:40 eadb4c
2001-01-17 18:13 ` waco_johnny_d
2001-01-19 14:45 ` waco_johnny_d
0 siblings, 2 replies; 5+ messages in thread
From: eadb4c @ 2001-01-17 12:40 UTC (permalink / raw)
Hi again!
Still no solution to running out of virtual memory during gcc snapshot
build. I checked all relevant proc and vm subsystem parameters. They are
set to sensible value (I think):
vm:
vm-maxvas = 1073741824 (1GB)
proc:
per-proc-stack-size = 2097152
max-per-proc-stack-size = 33554432
per-proc-data-size = 134217728
max-per-proc-data-size = 1073741824
max-per-proc-address-space = 1073741824
per-proc-address-space = 1073741824
maxusers is set to 32, but I don't think it can matter, it is just a
workstation with no more than 2-3 users logged in. Before starting
compilation I make all possible ulimit settings to unlimited, so it
reads:
core file size (blocks) unlimited
data seg size (kbytes) 1048576
file size (blocks) unlimited
max memory size (kbytes) 505688
open files 4096
pipe size (512 bytes) 8
stack size (kbytes) 32768
cpu time (seconds) unlimited
max user processes 64
virtual memory (kbytes) 1048576
Then I start the compilation and monitor the amount of free memory and
swap. Some strange things that I've noticed: in spite of the fact that
there is still free memory, the percentage of used swap also grows as
memory is allocated. Even when there are tons of free memory (like 40K
pages), both this memory AND swap are utilized, which I can't explain.
When the amount of memory occupied by the process (sum of free memory
plus swap) reaches approximately 150MB, it aborts, saying "Virtual
memory exhausted" - but there is still 20-30K pages of free memory and
at least 50% of swap left!!! Tracing the kernel calls shows, that the
process is aborted when mmap fails with ENOMEM.
The questions now are: why it uses swap, when free memory is still
available and what limit am I overlooking?
Thanks to waco_johnny_d for a hint.
J.
Sent via Deja.com
http://www.deja.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Virtual memory exhausted
2001-01-17 12:40 Virtual memory exhausted eadb4c
@ 2001-01-17 18:13 ` waco_johnny_d
2001-01-19 14:45 ` waco_johnny_d
1 sibling, 0 replies; 5+ messages in thread
From: waco_johnny_d @ 2001-01-17 18:13 UTC (permalink / raw)
Hi again J,
> vm:
> vm-maxvas = 1073741824 (1GB)
As long as you're sure your program won't try to use more, this looks
ok. How much memory in the workstation, by the way? (Apologies in
advance if you've already provided this information.)
> proc:
> [...]
> per-proc-data-size = 134217728
I would go ahead and make this 1GB, same as for vm-maxvas and the other
per-proc stuff that's set to 1GB. With that 134MB setting, you might be
placing a ceiling on the memory you can use.
> maxusers is set to 32, but I don't think it can matter, it is just a
> workstation with no more than 2-3 users logged in.
A common misconception regarding "maxusers" is that it has to do only
with the maximum number of users on the system. This is not true -- it
actually controls several other important parameters (explained in the
tuning guide). I would go ahead and kick this WAY up as I said before.
> Before starting
> compilation I make all possible ulimit settings to unlimited, so it
> reads:
>
> core file size (blocks) unlimited
> data seg size (kbytes) 1048576
> file size (blocks) unlimited
> max memory size (kbytes) 505688
> open files 4096
> pipe size (512 bytes) 8
> stack size (kbytes) 32768
> cpu time (seconds) unlimited
> max user processes 64
> virtual memory (kbytes) 1048576
>
I've never had to do anything with ulimit -- always done it in
sysconfigtab, so I can't comment here, except to ask whether you have
set your soft limits all the way up to what the hard limits will allow?
Have you compared the outputs of "ulimit -aS" and "ulimit -aH"?
> Then I start the compilation and monitor the amount of free memory and
> swap. Some strange things that I've noticed: in spite of the fact that
> there is still free memory, the percentage of used swap also grows as
> memory is allocated. Even when there are tons of free memory (like 40K
> pages), both this memory AND swap are utilized, which I can't explain.
> When the amount of memory occupied by the process (sum of free memory
> plus swap) reaches approximately 150MB, it aborts, saying "Virtual
> memory exhausted" - but there is still 20-30K pages of free memory and
> at least 50% of swap left!!! Tracing the kernel calls shows, that the
> process is aborted when mmap fails with ENOMEM.
>
> The questions now are: why it uses swap, when free memory is still
> available and what limit am I overlooking?
>
You're probably using aggressive (immediate) swap, right? See the
"swapon" man page for more. You may be able to get by with lazy
(deferred) swap if no one's going to complain if processes die on the
workstation because they can't get swap space. Production systems that
can't crash or lose processes due to swap unavailability generally use
immediate swap, but this may not reflect your needs, i.e. you may not
need to be as conservative.
Hope this helps a little more,
WJD
Sent via Deja.com
http://www.deja.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Virtual memory exhausted
2001-01-17 12:40 Virtual memory exhausted eadb4c
2001-01-17 18:13 ` waco_johnny_d
@ 2001-01-19 14:45 ` waco_johnny_d
1 sibling, 0 replies; 5+ messages in thread
From: waco_johnny_d @ 2001-01-19 14:45 UTC (permalink / raw)
Also check vm-vpagemax and vm-mapentries (V4.x).
WJD
Sent via Deja.com
http://www.deja.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Virtual memory exhausted
@ 2001-01-15 15:24 eadb4c
2001-01-16 12:44 ` waco_johnny_d
0 siblings, 1 reply; 5+ messages in thread
From: eadb4c @ 2001-01-15 15:24 UTC (permalink / raw)
Hi!
While compiling a recent gcc snapshot (2001-01-08), I've received
"Virtual memory exhausted" message. When monitoring the amount of
available swap space and virtual memory with vmstat and swapon during
the compilation, I've found, that at least 80% of 768 MB swap were
free, which indicates, that there is some kind of per-user or
per-process limit, which I failed to find. In ulimit the available
amount of virtual memory is set to "virtual memory (kbytes)
1048576", so it is unlikely to be the problem. Looking on the parameters
of vm subsystem with sysconfig -q also didn't give any hints -
everything seems to be ok there. Anybody got any ideas?
Machine is XP1000 with uname -a: "OSF1 ... V4.0 1091 alpha"
Best regards,
J.
Sent via Deja.com
http://www.deja.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Virtual memory exhausted
2001-01-15 15:24 eadb4c
@ 2001-01-16 12:44 ` waco_johnny_d
0 siblings, 0 replies; 5+ messages in thread
From: waco_johnny_d @ 2001-01-16 12:44 UTC (permalink / raw)
Hi J,
You might be looking in the wrong subsystem. Try
"sysconfig -q proc | grep maxusers" and
"sysconfig -q proc | grep proc" and see what you get.
Maybe maxusers is too low (I generally run mine at
512 or higher on production systems, higher on test
systems) as well as the following:
max_proc_per_user
per_proc_stack_size
max_per_proc_stack_size
per_proc_data_size
max_per_proc_data_size
per_proc_address_space
max_per_proc_address_space
On most of my systems I run the 2 data_size and 2 address_space
params right up to 4GB.
Give this a shot & let us know, ok?
WJD
p.s. Depending on the O.S. version, those underscores above might
be dashes instead.
Sent via Deja.com
http://www.deja.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-01-19 14:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-17 12:40 Virtual memory exhausted eadb4c
2001-01-17 18:13 ` waco_johnny_d
2001-01-19 14:45 ` waco_johnny_d
-- strict thread matches above, loose matches on Subject: below --
2001-01-15 15:24 eadb4c
2001-01-16 12:44 ` waco_johnny_d
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox