Operating System - HP-UX
1753577 Members
6712 Online
108796 Solutions
New Discussion юеВ

Unable to allocate memory

 
SOLVED
Go to solution
ShivS
Frequent Advisor

Unable to allocate memory

Hi Experts,

My process needs to allocate around 1GB memory and it does so using new operator.

Following are the system details:
HP-UX B.11.23 U ia64 0409362437 unlimited-user license

Following is output from kmtune for data segment size:
kmtune | fgrep maxdsiz
maxdsiz 1073741824 Default Immed
maxdsiz_64bit 8589934592 8589934592 Immed


Following is the output of swampinfo command:
/usr/sbin/swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 4020 76 98% 0 - 1 /dev/vg00/lvol2
dev 10000 5207 4793 52% 0 - 1 /dev/vg01/lvol7
dev 16000 2699 13301 17% 0 - 1 /dev/vg01/lvol6
reserve - 17387 -17387
memory 18425 5344 13081 29%
total 48521 34657 13864 71% - 0 -


Following is the output of memprog command:
memprog
Memory Stat total used avail %used
physical 18424.9 18315.0 109.9 99%
active virtual 58409.2 3655.2 54754.0 6%
active real 7147.5 282.0 6865.5 4%
memory swap 18424.9 5344.4 13080.5 29%
device swap 30096.0 29319.2 776.8 97%


Following is the output from gdb:
gdb compile_ocp_holding_x core.compile_ocp_holding_x
Detected 64-bit executable.
Invoking /usr/ccs/bin/gdb64.
HP gdb 3.4 for PA-RISC 2.0 (wide), HP-UX 11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 3.4 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `compile_ocp_holding_x'.
Program terminated with signal 11, Segmentation fault.
#0 0x400000000006fd54 in grow_arena+0x2b4 ()
(gdb) where
#0 0x400000000006fd54 in grow_arena+0x2b4 ()
#1 0x400000000006e2c4 in real_malloc+0x67c ()
#2 0x400000000006baf0 in _malloc+0x670 ()
#3 0x4000000000070c34 in malloc+0x1c4 ()
#4 0x400000000004f034 in operator new []+0x4c ()
#5 0x40000000000423b0 in generate_holding_owner_lookup_binary (load_dir=0x9fffffffe000180b "/tfsw/ocp/production/loadA",
rpt_file_name=0x9fffffffe0001829 "ocp_holding_reg.rpt", holding_indx_owner_x=0x800000010801ef48, rpt_file_num_rows=@0x9fffffffe0005c40)
at compile_ocp_holding_x.cc:339
#6 0x40000000000443f4 in generate_binaries (load_dir=0x9fffffffe000180b "/tfsw/ocp/production/loadA",
rpt_file_name=0x9fffffffe0001829 "ocp_holding_reg.rpt", start_addr_map=@0x9fffffffe0004838, num_rows_map=@0x9fffffffe0004898)
at compile_ocp_holding_x.cc:820
#7 0x4000000000044920 in main (argc=5, argv=0x9fffffffe0001000) at compile_ocp_holding_x.cc:895
(gdb)


Note that the program is 64 bit compiled using the following compilation/linking flags:
-Wl,+n,-a,archive -D_HPUX_SOURCE +DA2.0W
on the HP machine with following uname details:
HP-UX B.11.11 U 9000/800 ocpdev1 unlimited-user license. The executable is then moved to IA64 machine and run where I get the above described allocation problem.

Can somebody please tell me how to correct this allocation problem?

Thanks in advance!

-Shiv.
11 REPLIES 11
James R. Ferguson
Acclaimed Contributor
Solution

Re: Unable to allocate memory

Hi Shiv:

You need to add physical memory and/or more swap.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Unable to allocate memory

>Following are the system details:

You should mention you are using Aries right away.

>Following is output from kmtune for data segment size:
>kmtune | fgrep maxdsiz => maxdsiz_64bit 8589934592

You should be using kctune(1m), not the obsolete kmtune(1m).
There should be two other kernel parms with "pa" for these two.

>Program terminated with signal 11, Segmentation fault.
#0 0x400000000006fd54 in grow_arena+0x2b4

Hmm, this should give an error return and not a signal. You may have heap corruption?

>-Wl,+n,-a,archive -D_HPUX_SOURCE +DA2.0W

You should be using +DD64 instead of the obsolete +DA2.0W.

>JRF: You need to add physical memory and/or more swap.

Unless the system was using more swap when it aborted, this will not help.
Dennis Handly
Acclaimed Contributor

Re: Unable to allocate memory

>ME: There should be two other kernel parms with "pa" for these two.

Oops, it appears these are only for the stack size:
pa_maxssiz_32bit pa_maxssiz_64bit
Rajesh K Chaurasia
Valued Contributor

Re: Unable to allocate memory

Since this is PA64 program I don't think the value of ARIES specific kernel tunable parameter pa_maxssiz_64bit would cause large memory allocation from emulated program to fail. That case is more relevant for PA32 programs.

pa_maxssiz_[32|64]bit do not specify the stack size for PA-RISC processes - they determine size of ARIES managed area in application data segment... more details in aries(5) man page.

As suggested earlier, please add more physical memory and/or swap.

Regards
-Rajesh
ShivS
Frequent Advisor

Re: Unable to allocate memory

Hi,

Some more swap memory has been added as seen from the swapinfo command:

/usr/sbin/swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 1280 2816 31% 0 - 1 /dev/vg00/lvol2
dev 16000 1279 14721 8% 0 - 1 /dev/vg01/lvol6
dev 10000 1284 8716 13% 0 - 1 /dev/vg01/lvol7
dev 600 600 0 100% 0 - 1 /dev/vg01/lvol1
dev 400 400 0 100% 0 - 1 /dev/vg01/lvol4
reserve - 16837 -16837
memory 18425 3228 15197 18%
total 49521 24908 24613 50% - 0 -


Output of the memprog command:
memprog
Memory Stat total used avail %used
physical 18424.9 18329.9 95.0 99%
active virtual 36418.5 2934.2 33484.3 8%
active real 10393.0 1571.2 8821.8 15%
memory swap 18424.9 3228.4 15196.5 18%
device swap 31096.0 21686.2 9409.8 70%

I am testing my programs so see if the memory related problems are resolved.

Thanks for all you help!
Shiv.
Dennis Handly
Acclaimed Contributor

Re: Unable to allocate memory

>Some more swap memory has been added as seen from the swapinfo command:

You have essentially added nothing. 1 Gb isn't much in the scheme of things, 2%. :-)

>I am testing my programs so see if the memory related problems are resolved.

As I mentioned above, you may have heap corruption.
ShivS
Frequent Advisor

Re: Unable to allocate memory

Hi Dennis,

How can I perform heap corruption diagnostics? What are the tools available on IA64 HP machine?

Regards,
Shiv.
James R. Ferguson
Acclaimed Contributor

Re: Unable to allocate memory

Hi (again) Shiv:

> How can I perform heap corruption diagnostics?

You need to use the debugger:

www.hp.com/go/wdb

On the upper right side of the web page is a link to documentation.

Regards!

...JRF...
ShivS
Frequent Advisor

Re: Unable to allocate memory

Hi James,

I have gdb and following are the details:
HP gdb 5.9 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.9 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.


Will this help in running the diagnostics? Also do I need a core file for running the diagnostics or I can simply run the exe file via gdb's run command and perform the diagnostics?

Thanks again for your help!

Regards,
Shiv.