HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Allocation Memory Problem
Operating System - HP-UX
1833151
Members
3353
Online
110051
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 12:24 AM
03-02-2006 12:24 AM
Hi,
I have a problem with application memory allocation.
I try to create a simple C program to verify memory allocation trough malloc system calls.
I verify with glance and see that the max allocate memory is 944MB VSS and 15MB RSS for my C process
I execute a tusc command to see the status of C program, and it return the following error:
brk(0x7b106000)....ERR#12 ENOMEM
I verify the values of kernel parametrs :
shmem 1
shmmax 0X200000000
shmmni 512
shmseg 512
maxdsiz 4294963200
maxdsiz_64bit 6442450944
maxfiles 300
maxfiles_lim 4224
maxqueuetime 0
maxssiz 0X800000
maxssiz_64bit 0X800000
maxswapchunks 2048
maxtsiz 0x4000000
maxtsiz_64bit 0X40000000
In attach the textof C programm.
Are there memory limitation that causes my error ?
Thanks for helps
Bye Filo
I have a problem with application memory allocation.
I try to create a simple C program to verify memory allocation trough malloc system calls.
I verify with glance and see that the max allocate memory is 944MB VSS and 15MB RSS for my C process
I execute a tusc command to see the status of C program, and it return the following error:
brk(0x7b106000)....ERR#12 ENOMEM
I verify the values of kernel parametrs :
shmem 1
shmmax 0X200000000
shmmni 512
shmseg 512
maxdsiz 4294963200
maxdsiz_64bit 6442450944
maxfiles 300
maxfiles_lim 4224
maxqueuetime 0
maxssiz 0X800000
maxssiz_64bit 0X800000
maxswapchunks 2048
maxtsiz 0x4000000
maxtsiz_64bit 0X40000000
In attach the textof C programm.
Are there memory limitation that causes my error ?
Thanks for helps
Bye Filo
Sistem engeneer expert
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 12:46 AM
03-02-2006 12:46 AM
Solution
944 megs is the maximum amount of RAM your 32bit program can allocate unless you adjust the compile and executable options. 32bit programs have 4 separate quadrants, each 1Gb in size. So the data area (where malloc starts allocation RAM) is 1Gb and with some overhead items, the limit is about 940megs. Note also that the kernel parameter maxdsiz (which is for 32bit programs) will further limit the maximum size.
Now, by recompiling your program with EXEC_MAGIC options, you can get both quadrant 1 (called 'text area' or the executable instructions) and quadrant 2 (local data area) to be treated as a single local data area, allowing your program to allocate up to about 1750megs. Try recompiling with:
cc -Ae -Wl -N -o myprog myprog.c
You can also modify the EXEC_MAGIC executable with the chatr program to map quadrant 3 and 4 (but VERY dependent on HP-UX version and patches). Or recompile your program as a 64bit program and all RAM limitations disappear (be sure to change maxdsiz_64 to a larger value, perhaps 20-50 Gb. Note that you do not need 30Gb of RAM to run a program that allocates 30Gb of memory -- just make sure you have plenty of swap, such as 40Gb of swap on a system with 4Gb of RAM. Yes, it will run and allocate the memory just fine although a lot of swap reservation will take place.
The attached program will demonstrate the following maximum malloc limits:
940megs
1750megs
2700megs
3700megs
and unlimited with 64bit compile.
Bill Hassell, sysadmin
Now, by recompiling your program with EXEC_MAGIC options, you can get both quadrant 1 (called 'text area' or the executable instructions) and quadrant 2 (local data area) to be treated as a single local data area, allowing your program to allocate up to about 1750megs. Try recompiling with:
cc -Ae -Wl -N -o myprog myprog.c
You can also modify the EXEC_MAGIC executable with the chatr program to map quadrant 3 and 4 (but VERY dependent on HP-UX version and patches). Or recompile your program as a 64bit program and all RAM limitations disappear (be sure to change maxdsiz_64 to a larger value, perhaps 20-50 Gb. Note that you do not need 30Gb of RAM to run a program that allocates 30Gb of memory -- just make sure you have plenty of swap, such as 40Gb of swap on a system with 4Gb of RAM. Yes, it will run and allocate the memory just fine although a lot of swap reservation will take place.
The attached program will demonstrate the following maximum malloc limits:
940megs
1750megs
2700megs
3700megs
and unlimited with 64bit compile.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 01:05 AM
03-02-2006 01:05 AM
Re: Allocation Memory Problem
Hi Bill,
thanks for Help.
I try to compile my C programm with your optinos:
usr/bin/cc -Ae -Wl -N -o program prova.c
I recived this output:
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (prova.o) was detected. The linked output may not run on a PA 1.x system
Can you re-send the attachment...I can't download it.
Thanks
Bye Filo
thanks for Help.
I try to compile my C programm with your optinos:
usr/bin/cc -Ae -Wl -N -o program prova.c
I recived this output:
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (prova.o) was detected. The linked output may not run on a PA 1.x system
Can you re-send the attachment...I can't download it.
Thanks
Bye Filo
Sistem engeneer expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2006 02:05 AM
03-02-2006 02:05 AM
Re: Allocation Memory Problem
The attached file displays fine. Rather than selecting download, just open it with Notepad and either copy the text or save the text as a local file on your PC. The warning message is normal. It means that the executable won't run on a very old HP box (ie, PA 1.1). Did the compilation produce as executable file (ie, "program")?
Bill Hassell, sysadmin
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP