1846090 Members
3484 Online
110182 Solutions
New Discussion

Re: Ulimit data

 
SOLVED
Go to solution
Carlos Munoz Lopez
Frequent Advisor

Ulimit data

Hi guys! According to what I've read in some posted messages if I want to change data in ulimit I have to increase maxdsize as well as maxdize_64 kernel parameters and then reboot the system. In my HP-UX 11i system maxdsize and maxdsize_64 were set to 1GB, I wanted to increase data from 256MB to 2GB, so I increased the two parameters mentioned above to 2GB. Once the system booted I checked data and the new value was 4292870144. This value is in kbytes. Why is this the new value? I mean, it was supposed to be 2GB instead of 4TB. I would like some help on this. Thanks.
1 REPLY 1
Bill Hassell
Honored Contributor
Solution

Re: Ulimit data

What is the output of kmtune | grep maxd

Did you make the changes with SAM or manually edit the system file and build your own kernel? NOTE: SAM has an annoying habit of mixing hex and decimal values for different parameters. All parameters can be specified in hex, decimal or as a formula (the least desirable) but in all cases, the decimal equivalent is shown at the bottom right of the setting's page. The number 4292870144 is just 4Gb rather than 4Tb, but you really don't have to change it. maxdsiz and maxdsiz_64 are simple fences or barriers and have no other effect except to limit the maximum size of a 32 or 64 bit program.

So if you want your program to malloc 2Gb or RAM, be sure you compile the program with -Wl -N flags, and to go beyond 2Gb, use chatr on the program's executable file as in:

chatr +q3p enable myprog

which will allow up to about 2700 megs. Of course, the best choice is to compile as a 64bit program, something like this:

cc -Ae +DD64 -o mallocmax mallocmax.c

By setting maxdisz_64 to 50000000000 (50 Gb) then this program can ask for as much as 50Gb of RAM. Note that HP-UX is a virtual memory system so memory beyond the size of RAM is provided by swap space.


Bill Hassell, sysadmin