Operating System - HP-UX
1831635 Members
1714 Online
110027 Solutions
New Discussion

How to increase RLIMIT_AS value

 
Prakash Mirji
New Member

How to increase RLIMIT_AS value

Hi,

Please find the below sample code, which gives RLIMIT_AS value.In one of our case, we need this "RLIMIT_AS' to be greater than 2GB or unlimited.How do we set this system wide?

output of the sample code now:

Core: Max:: 2147483647, Core: Min:: 2147483647
Dsiz: Max:: 1737486336, Dsiz: Min:: 1737486336
Stack: Max:: 401604608, Stack: Min:: 401604608


Sample code:

#include
#include
#include
#define SUCCESS 0

int main(void)
{
int ret = 0;
struct rlimit rlp = {0};
int retval = EXIT_SUCCESS;

if ((ret = getrlimit(RLIMIT_AS, &rlp)) != SUCCESS)
{
perror("getrlimit() -- total");
retval = EXIT_FAILURE;
goto exit;
}
fprintf(stdout, "Total Process Memory: Max:: %ld, Core: Min:: %ld\n",
rlp.rlim_max, rlp.rlim_cur);

if ((ret = getrlimit(RLIMIT_DATA, &rlp)) != SUCCESS)
{
perror("getrlimit() -- dsiz");
retval = EXIT_FAILURE;
goto exit;
}
fprintf(stdout, "Dsiz: Max:: %ld, Dsiz: Min:: %ld\n",
rlp.rlim_max, rlp.rlim_cur);

if ((ret = getrlimit(RLIMIT_STACK, &rlp)) != SUCCESS)
{
perror("getrlimit() -- stack");
retval = EXIT_FAILURE;
goto exit;
}
fprintf(stdout, "Stack: Max:: %ld, Stack: Min:: %ld\n",
rlp.rlim_max, rlp.rlim_cur);
exit:
return retval;
}
2 REPLIES 2
Mark Nieuwboer
Esteemed Contributor

Re: How to increase RLIMIT_AS value

Hi,

See this link maybe it help.
http://docs.hp.com/en/B9106-90009/getrlimit.2.html

grtz. Mark
Alexey Roytman
Frequent Advisor

Re: How to increase RLIMIT_AS value

If it's 32-bit application, you cannot set RLIMIT_AS over 1.9GB.

Otherwise, if it's 64-bit application, check:
kmtune | grep maxd
kernel parameters for maximal data segment size for both 32- and 64-bit applications.