1753599 Members
6449 Online
108796 Solutions
New Discussion юеВ

Memory allocation limit

 
SOLVED
Go to solution
Gautam Shet
Advisor

Memory allocation limit

Hi folks,
I am experiencing an unusual problem in that, I cannot allocate memory of size ~ 67 MB on a machine having 512 MB main memory. I am using the standard C routine malloc() to allocate the memory. BTW this is a 32 bit application.

Could it be some system setting that has some limitation set to the memory allocation?. I would apperciate any pointers to resolve this problem.
4 REPLIES 4
Michael Tully
Honored Contributor

Re: Memory allocation limit

Have a look at this posting:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=210579
Anyone for a Mutiny ?
James Murtagh
Honored Contributor

Re: Memory allocation limit

Hi Gautam,

The problem will be kernel tunable maxdsiz for malloc requests for 32bit processes. You haven't mentioned the OS but the default on 10.20 and 11.00 is 67MB, defined in /usr/conf/master.d/core-hpux ;

# grep MAXDSIZ core-hpux
maxdsiz MAXDSIZ 0x04000000
# echo 0x04000000=D|adb
67108864

On 11i the default is raised to 256MB.

Cheers,

James.
Elmar P. Kolkman
Honored Contributor
Solution

Re: Memory allocation limit

It is 67 million bytes, which is in fact 64 Megabyte, depending on what you think of as Megabyte. In computer terms it is 1024 * 1024 bytes, while a lot of HD vendors think of Mb as 1000*1000 bytes...

So do a grep of maxdsiz in /stand/system. If it is not there, your limit is probably 64Mb (or 67108864) and you should start sam to change it if you are allowed to.
Every problem has at least one solution. Only some solutions are harder to find.
Gautam Shet
Advisor

Re: Memory allocation limit

Hi folks,
Thanks for all your replies. Once I increased the value of maxdsiz to 256MB, using sam, the memory allocation went through fine.