General
cancel
Showing results for 
Search instead for 
Did you mean: 

maxdsiz_64bit for 64 bit application

 
hot948
Occasional Contributor

maxdsiz_64bit for 64 bit application

Hi

 

Eventhough maxdsiz_64bit = 4G, my test program allocated only 1G.

What should I check?

 

#kctune | grep maxd

maxdsiz                          1073741824  Default      Immed

maxdsiz_64bit               4294967296  Default      Immed

 

#

# echo maxdsiz_64bit/2d | adb /stand/vmunix /dev/kmem
maxdsiz_64bit: 
                0               1048576  <== 4G

 

#uname -a

HP-UX hostname B.11.23 U ia64

 

#cc +DD64 -o test64 test.c

 

#file test64

test64: ELF-64 executable object file - IA64

 

#./test64

2 meg malloc'ed

3 meg malloc'ed

.

sniped

.

.

1024 meg malloc'ed  <=== lst here, I expect 4G

#

#cat test.c

 

  $ cat test.c

  main () {

               char *mem[250000];  /* one MB here */

               int i, j;

               for (i = 2; mem[i] = (char *) malloc(1024 *1024); i++)

                       printf("%d meg malloc'ed\n",i);

       }

 

Regards

1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: maxdsiz_64bit for 64 bit application

You are compiling with +DD64 so that should do it.  Unless ulimit was set to make maxdsiz_64bit smaller.

You need to call getrlimit64(2) in your program to see if has been lowered:

getrlimit64(RLIMIT_DATA, &rlp);