1825767 Members
2001 Online
109687 Solutions
New Discussion

Re: ulimit -d unlimited

 
SOLVED
Go to solution
Juan M Leon
Trusted Contributor

ulimit -d unlimited

Hello everyone, I hope spmeone can help me with a problem I have.
How can I set ulimit -d unlimited this is for data size

currently I have this values

time(seconds) unlimited
file(blocks) unlimited
--> data(kbytes) 1048576 <---
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 2048
18 REPLIES 18
Steven E. Protter
Exalted Contributor
Solution

Re: ulimit -d unlimited

Shalom,

man pages exist to help.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=813713

http://www.darklab.net/resources/hpux-mailinglist/0733.html

Remember however in reality there are still OS limits on the data size, in the kernel. Oracle is likely to be unhappy with the setting as well, though I've used it. The standard oraenv scripts can be broken by this change.

Change it in the .profile for the user or script that needs it, not globally.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: ulimit -d unlimited

Once the value is set, you can't increase it, unless it was a soft limit.
What does ulimit -Sa show?

To get it higher, (it can never be unlimited), you must not set it in /etc/profile nor in .profile. And you have to increase maxdsiz_64 and then maxdsiz, then relogin.
whiteknight
Honored Contributor

Re: ulimit -d unlimited

Hi Juan,

Check this article.

ulimit's relationship to maxdsiz, maxssiz, maxfiles

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c00905065-5


WK
please assign points
Problem never ends, you must know how to fix it
Juan M Leon
Trusted Contributor

Re: ulimit -d unlimited

This is the output for ulimit -Sa
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 2015464
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303

Thanks
Juan M Leon
Trusted Contributor

Re: ulimit -d unlimited

Thanks all for your suggestions and comments.
IS there a documentation to indicates why the data section on ulimit cannot be set to unlimited.

James R. Ferguson
Acclaimed Contributor

Re: ulimit -d unlimited

Hi Juan:

> IS there a documentation to indicates why the data section on ulimit cannot be set to unlimited.

If there were truly no ceiling ("unlimited") then there would be no need for the 'maxdsiz' and/or 'maxdsiz_64' kernel parameters.

Regards!

...JRF...
Juan M Leon
Trusted Contributor

Re: ulimit -d unlimited

James,

Thank you for your comment. question on another Unix like AIX you are able to set data to uinlimited.

Sorry but I am not familiar with this type of issues.

Thank you
Sandman!
Honored Contributor

Re: ulimit -d unlimited

Check out the man pages of setrlimit(2) and getrlimit(2) for more information about setting the data size of a process to unlimited. Also check out the section on RLIM_INFINITY and its value as defined in the /usr/include/sys/resource.h file.

~hope it helps
Don Morris_1
Honored Contributor

Re: ulimit -d unlimited

You should be able to set data to unlimited if you have sufficient permission (i.e. you are superuser). That equates to using setrlimit() to set RLIMIT_DATA to RLIM_INFINITY. Since you're raising the hard limit, you must have permissions [as the setrlimit() man page describes]. If you can't, please specify what release you're running on... (if you're on 11.11, make sure you have PHKL_25993).

For further checking, compile and run the attached program. Sample output:
$ cc +DD32 -o data_inf data_inf.c
$ ./data_inf
My current Data hard/soft limits: 0x40000000 / 0x40000000 bytes.
setrlimit failure: Not owner
$ su
Password:
# ./data_inf
My current Data hard/soft limits: 0x40000000 / 0x40000000 bytes.
Data soft limit now: unlimited
Data hard limit now: unlimited

Note that setting the limits to infinity will only bypass the maxdsiz/maxdsiz_64bit tunables for the process (and its children which inherit the parent's resource limits). It doesn't mean squat regarding reservable swap space, quadrant boundaries, running into other objects, etc which are more likely to limit your data size anyway. HP-UX Architectural layouts are way too big to summarize in a forum post, man 1 chatr for an overview.
Juan M Leon
Trusted Contributor

Re: ulimit -d unlimited

My HPUX is B.11.23 U ia64
Don Morris_1
Honored Contributor

Re: ulimit -d unlimited

Hmm... had to poke around there.

A couple points:

1) An important clarification, the system tunables do still enforce limits [even with values of unlimited]. This is good -- since that's the point of the tunables. I missed a follow up check when I scanned the source earlier. Sorry for the misinterpretation.

2) 11.31 was modified to allow you to set unlimited [even though what it really means is unlimited until you hit the current tunable setting]. Past releases will not be patched for this behavior (needless to say, I ran this on an 11.31 box since that's what I had available).

Don
Juan M Leon
Trusted Contributor

Re: ulimit -d unlimited

question for all.
Any of the values have limitations althoug they said unlimited.
how is possible to set time,file and memory to unlimited?

Thank you
Dennis Handly
Acclaimed Contributor

Re: ulimit -d unlimited

>how is possible to set time,file and memory to unlimited?

Time and file can be set to unlimited, the OS doesn't normally care about that.

I have no idea what memory is related to, since data tracks maxdsiz. I do see RLIMIT_AS that mentions mmap.

But it doesn't help that sh-posix(1) doesn't document ulimit -m.




Dennis Handly
Acclaimed Contributor

Re: ulimit -d unlimited

It seems the setrlimit(2) is broken. It mentions RLIMIT_AS as memory but says open files.

Also, tusc says that ulimit -m sets RLIMIT_RSS.
Don Morris_1
Honored Contributor

Re: ulimit -d unlimited

is wrong. RLIMIT_AS is the total address space limit for the process (and is checked as such). Someone got a little exuberant copy and pasting comments for RLIMIT_NOFILE and RLIMIT_OPEN_MAX, I'd expect.

By default it gets RLIM_INFINITY and I don't think many folks think to change it... so it is effectively unlimited by default unless you lower your soft limit. There's no kernel tunable for it like data/stack/text.
Juan M Leon
Trusted Contributor

Re: ulimit -d unlimited

All thank you for your comments.
This type of information is very interesting. But I believe it is out of my league. I will have to read more to understand all your comments.

Don at some point you mention:
Note that setting the limits to infinity will only bypass the maxdsiz/maxdsiz_64bit tunables for the process (and its children which inherit the parent's resource limits). It doesn't mean squat regarding reservable swap space, quadrant boundaries, running into other objects, etc which are more likely to limit your data size anyway

Would you mind to tell ne step by step what I need to do to change to unlimited. I just need to show to my application people that by changing to unlimted will not solve their problem and that they need to look more into their application. Thank you

Juan M Leon
Trusted Contributor

Re: ulimit -d unlimited

Don,

I executed the C program and I got setrlimit Invalid argument, the following output

root> ./data_inf
My current Data hard/soft limits: 0xfffff000 / 0xfffff000 bytes.
setrlimit failure: Invalid argument

Thank you
Don Morris_1
Honored Contributor

Re: ulimit -d unlimited

Right -- note my followup message which clarified a couple points:

1) You can't set to unlimited on releases prior to v3. (The fact that I don't have anything else laying around at this point unfortunately means that sometimes I slip up and don't check v2 or v1 source thoroughly enough to realize we changed things).

2) Even when you do, maxdsiz is still enforced. (Just like architectural and other limits are still enforced).

Frankly (and bluntly), I'd just stop worrying about what the shell program tells you. "unlimited" is a lie no matter what (and I'd argue that it is a lie on every OS -- you'll always hit *some* limit, be it architectural or resource or whatnot... HP-UX just adds in a system-wide sledgehammer of a limit in the max*siz tunables). If you want more data space, raise maxdsiz/maxdsiz_64bit. If you want more data space in a 32-bit process -- raise maxdsiz, but pay close attention to your compilation model [because by default you'll only get 1Gb of data/stack/private object space anyway, 2Gb goes to shared, 1Gb for Text]. For 64-bit, the tunable or swap space should stop you before you hit the architecture limits on current boxes (we're talking petabytes for the data octant).

v3 is nicer in that it lets you lie to yourself, that's all. And to the best of my knowledge, there is no intention or plan to backport that change to prior releases. [If you feel passionately about it, certainly feel free to contact your Support channel -- they can argue the case internally.]