Operating System - HP-UX
1834018 Members
2336 Online
110063 Solutions
New Discussion

Re: malloc failed in ObjStackBlock

 
SOLVED
Go to solution
Starrynight
Advisor

malloc failed in ObjStackBlock

Hi all

I have a executable that crashes with the following error message:
"malloc failed in ObjStackBlock.
Out of memory while reading in symbol table
Error<1>: Out of memory while tracing stack.
Error<1>: Out of memory while tracing stack.
Error<1>: Out of memory while tracing stack.

The OS version is HP-UX 11.00 and runs a 64-bit processor. The executable runs a 32-bit so I increased the maxssiz kernel tunable to it's maximum value.
The situation persists.

Can anyone help....

Thanks
SN
System administrator
5 REPLIES 5
harry d brown jr
Honored Contributor

Re: malloc failed in ObjStackBlock

This

kmtune | grep max.siz*

produces what?

live free or die
harry d brown jr
Live Free or Die
Starrynight
Advisor

Re: malloc failed in ObjStackBlock

Hey

# kmtune | grep max.siz*
maxdsiz 0X19000000
maxdsiz_64bit 0x0000000040000000
maxssiz 0X17F00000
maxssiz_64bit 1073741824
maxtsiz 0x04000000
maxtsiz_64bit 0x0000000040000000

maxssiz_64bit was allready in it's maximum value so I did nothing. I thought I just had to increase maxssiz (since the executable runs at 32-bit), do you have a diferent opinion?

Thanks
SN
System administrator
harry d brown jr
Honored Contributor

Re: malloc failed in ObjStackBlock

If this puppy (the program) is a memory pig, then you need to increase maxdsiz to x40000000 or until you hit the 2gb mark of x80000000.

live free or die
harry d brown jr
Live Free or Die
Bill Hassell
Honored Contributor
Solution

Re: malloc failed in ObjStackBlock

maxdsiz=0X19000000 is only 420 megs. I prefer writing all the kernel parameters in decimal rathern than hex (SAM and the kernel builder accept either format). Change maxdsiz to at least 960 megs (maxdsiz is in bytes, not kbytes), or if you have the ability to recompile/relink the executable, change it to an EXEC_MAGIC executable and now the 32bit program can potentially use up to 1750 megs (change maxdsiz to 1750megs).

The maxdsiz value is also very small (nowhere near it's max value of terabytes). Change maxdsiz_64 to at least 4Gb (4 with 9 zeros in decimal). maxdsiz_64 must always be larger than maxdsiz because the lesser of the 2 values will be used for 32bit programs.

maxssiz refers to the stack size, normally a few megs. Most often the error will be a stack overflow, not a memory allocation (malloc) error. maxssiz=17F00000 is actually 400 megs, but 32bit programs (depending on your version of HP-UX) can only address 79megs. It is very unlikely the stack is being manipulated using malloc.

maxtsiz=0x4000000 is 67megs, more than enough for the largest program. The text area is the actual instruction set not counting any data. The physical size of the executable file on disk is roughly equal to the text area needed. Only a program with millions of lines of code would need dozens of megs for the text area.

Finally, check your swap usage while the program runs with: swapinfo -tm
If the disk swap area(s) are almost full, you can temporarily add more swap space with the swapon command. Note that if you're using a lot of swap space, your applications are running much, much slower. Add more memory to speed things up.


Bill Hassell, sysadmin
Starrynight
Advisor

Re: malloc failed in ObjStackBlock

Hey Harry and Bill

I want to thank you very much for your help...it solved my problem and plus I know now much more about memory segments.
Thank you very much.

SN
System administrator