I tried ulimit -v and it kept saying
ulimit: cannot raise limit: Invalid argument
I am running bash 1.14.7. I took a look at the source
and in bash-1.14.7/builtins/ulimit.def there is the
code segment
case u_MAX_VIRTUAL_MEM:
if (setting)
{
errno = EINVAL;
return ((RLIMTYPE)-1);
}
else
{
#if defined (HAVE_RESOURCE)
return (getmaxvm (mode));
#else /* !HAVE_RESOURCE */
errno = EINVAL;
return ((RLIMTYPE)-1);
#endif /* !HAVE_RESOURCE */
}
which tells me that if you are setting, the -v paramter
will always fail with EINVAL (Invalid argument).
I also experimented with ulimit -s and ulimit -m and the
ulimit -v value appears to be a sum of the ulimit -d and
ulimit -s arguments. Now I do not know if this is just
fluff added to bash because they hadn't finished coding
that part or they actually changed the maximum virtual
memory setting.
bash-2.02.1 appears to have a rewrite of this ulimit.def
file (haven't looked at that yet though) and I could always
write a wrapper that does the setrlimit and then execs
whatever I tell it to.
Do you know what equivalent setrlimit goes with ulimit -v.
I checked the manual page on setrlimit and there is an argument
for RLIMIT_DATA, RLIMIT_STACK, RLIMIT_RSS which correspond
to ulimit -d, -s, and -m but there is not one for ulimit -v.
I also noticed that allocation of data blocks larger than
128k would go into 0x400????? memory address space and the
blocks smaller than 0x804????? memory address space. So
they are definitely in different places. My question is
how come ulimit -d does not control both places.
The 0x400????? seems to tap out at about 8M and the
0x804????? is controlled via the ulimit -d. However, whats
the point of a ulimit -d if you can just allocate larger
blocks in a different memory area and have no affect on your
data size.
Brian Ackerman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html