Operating System - HP-UX
1752806 Members
5942 Online
108789 Solutions
New Discussion

allocate over 2gbytes with malloc()

 
hiro shin
New Member

allocate over 2gbytes with malloc()

Can I allocate over 2g byte memory with malloc() in 32bit application?

for example,
malloc(2147483648);
or
malloc(3000000000);

platform: HP-UX 11iv3 IPF
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: allocate over 2gbytes with malloc()

The correct forum for HP-UX questions is the ITRC forum: HP-UX > languages and scripting:
http://forums.itrc.hp.com/service/forums/categoryhome.do?categoryId=150

If you want to allocate over 1 Gb, you need to link with -N. I don't think you can get a continuous 3 Gb chunk since it may not be able to cross the quadrant boundary.

You can try by using "chatr +q3p enable".