Operating System - HP-UX
1826388 Members
4366 Online
109692 Solutions
New Discussion

Re: can't allocate memory

 
SOLVED
Go to solution
Ken Stallings
Advisor

can't allocate memory

I have a user running into this error message when attempting to test internal software module. The error mesg is requesting about 700 MB. maxdsize is set to 889 MB, and swapinfo shows about 1 GB free. vmstat only reports about 400 MB free though. ulimit -d is set to 889 MB also.
How can I tell what might be causing the problem? Should I increase maxdsiz again? This system has 2 GB physical memory about 1.5 Gb swap. TIA
15 REPLIES 15
Carlos Fernandez Riera
Honored Contributor
Solution

Re: can't allocate memory

Increase swap to 3 or 4Gb
unsupported
Steven Sim Kok Leong
Honored Contributor

Re: can't allocate memory

Hi,

Is there any installation guide for this application that gives the minimum resource requirements?

Try increasing the maxdsiz to 1 GB. Btw, is your application 64-bit? If it is, then remember to increase maxdsiz_64bit as well.

Hope this helps. Regards.

Steven Sim Kok Leong
federico_3
Honored Contributor

Re: can't allocate memory


The swap area should be 2*RAM



Ciao
Federico
Carlos Fernandez Riera
Honored Contributor

Re: can't allocate memory

See reserved on swapinfo.

add 700Mb and you will find it not keeps on your swap area.

Increase swap area.
unsupported
Olav Baadsvik
Esteemed Contributor

Re: can't allocate memory


You should try to find out if it is
your application or hp-ux that is
giving this error-message. I would think
it is from the application.

One thing you should check in addition
to maxdsiz and swap, is resources
for shared memory.

Olav
Ken Stallings
Advisor

Re: can't allocate memory

Thanks all. I added another 700 MB swap but I won't know if it helps until the developer reports back to me.
If this does fix the problem, why would this be needed when we already have 1 GB free and the user's module is only requesting about 650 MB?
Carlos Fernandez Riera
Honored Contributor

Re: can't allocate memory

First thing a procces must do is reserve swap space. So if you dont configure as swap ( at least) than physical memory you will not be able to use all.
unsupported
pap
Respected Contributor

Re: can't allocate memory

Hi Sean,
Yes,
1. you have to increase swap space to minimum 2GB.
2. Increase your maxdsiz parameter as below :

maxdsiz for 32-bit processes

Minimum : 0x400000 (4 MB)
MAximum : 0x7B03A000 ( aPPROX. 2GB)

Maxdsiz_64bit for 64 Bit processes :
min : 0x400000 (4 MB)
max: 4396972769279

You can set your maxdsiz parameter to the max value. This will resolve your problem.

Thanks,
-Piyush.
"Winners don't do different things , they do things differently"
Bill Hassell
Honored Contributor

Re: can't allocate memory

If the developer is writing a 32bit application, there are a lot of restrictions and map limitations. The 2Gb of RAM you have is not directly available as 2Gb. Instead, programs have 1Gb data, text and stack quadrants which are further restricted by all the other processes and use of memory on your system.

Print out a a copy of the memory and process management white papers in /usr/share/doc. There are two versions: plain text and the easier to read Postscript versions. 32bit programs are severely constrained when RAM gets into hundreds of megs. 64bits removes the restrictions (well, terabytes of RAM)


Bill Hassell, sysadmin
John Payne_2
Honored Contributor

Re: can't allocate memory

To say that you "have" to increase the swap space may be strong wording. You may not necessarily 'need' to have swap equal to or greater than physical memory. It is true that the system wants to lock a swap area for a process when it is exec'ed or fork'ed. If you have the kernel param 'swapmem' set to 1, you are enabling what is called 'psuedoswap'. psuedoswap allows up to 3/4 of your physical memory to act as swap area for the locking of the swap area. On a system where you have this enabled, and you have low paging, the system can be perfectly happy 'borrowing' physical memory for swap area. On a system where swapmem is set to zero, and you have less swap than memory, the system has to stop allocating space for processes when you hit the limit based on your swap size.

It is up to you. For me, it is a waste of space to have disk used just to have swap area to lock on systems with more than 2GB physical memory. (Think of it this way, you should never be in a situation where you have to use the swap space. It is a stop-gap for emergencies. When you find you are using it, you should start planning your next step, either relieving the pressure by moving apps, or upgrading the machine. This is just me talking, though.) (I also don't even want to get into databases and their requirements for swap.) If you have a canned package, they should also be giving you minimum guidelines on how your system is configured...

John
Spoon!!!!
John Payne_2
Honored Contributor

Re: can't allocate memory

To say that you "have" to increase the swap space may be strong wording. You may not necessarily 'need' to have swap equal to or greater than physical memory. It is true that the system wants to lock a swap area for a process when it is exec'ed or fork'ed. If you have the kernel param 'swapmem' set to 1, you are enabling what is called 'psuedoswap'. psuedoswap allows up to 3/4 of your physical memory to act as swap area for the locking of the swap area. On a system where you have this enabled, and you have low paging, the system can be perfectly happy 'borrowing' physical memory for swap area. On a system where swapmem is set to zero, and you have less swap than memory, the system has to stop allocating space for processes when you hit the limit based on your swap size.

It is up to you. For me, it is a waste of space to have disk used just to have swap area to lock on systems with more than 2GB physical memory. (Think of it this way, you should never be in a situation where you have to use the swap space. It is a stop-gap for emergencies. When you find you are using it, you should start planning your next step, either relieving the pressure by moving apps, or upgrading the machine. This is just me talking, though.) (I also don't even want to get into databases and their requirements for swap.) If you have a canned package, they should also be giving you minimum guidelines on how your system is configured...

John
Spoon!!!!
John Payne_2
Honored Contributor

Re: can't allocate memory

To say that you "have" to increase the swap space may be strong wording. You may not necessarily 'need' to have swap equal to or greater than physical memory. It is true that the system wants to lock a swap area for a process when it is exec'ed or fork'ed. If you have the kernel param 'swapmem' set to 1, you are enabling what is called 'psuedoswap'. psuedoswap allows up to 3/4 of your physical memory to act as swap area for the locking of the swap area. On a system where you have this enabled, and you have low paging, the system can be perfectly happy 'borrowing' physical memory for swap area. On a system where swapmem is set to zero, and you have less swap than memory, the system has to stop allocating space for processes when you hit the limit based on your swap size.

It is up to you. For me, it is a waste of space to have disk used just to have swap area to lock on systems with more than 2GB physical memory. (Think of it this way, you should never be in a situation where you have to use the swap space. It is a stop-gap for emergencies. When you find you are using it, you should start planning your next step, either relieving the pressure by moving apps, or upgrading the machine. This is just me talking, though.) (I also don't even want to get into databases and their requirements for swap.) If you have a canned package, they should also be giving you minimum guidelines on how your system is configured...

John
Spoon!!!!
John Payne_2
Honored Contributor

Re: can't allocate memory

Sorry about that, something was wrong with the forum, got an error twice, and the post didn't show up. Then third time, all three showed...

John
Spoon!!!!
MOI_1
Occasional Advisor

Re: can't allocate memory

hi
you have to check wether you have 32 or 64 bit application
if you have in both cases you have to ask the vendor of that application to tell you the right value parameter from maxdsiz and maxdsiz_64bit.
second, try to increase your swap by 2 or 2.5 the ram
because there are some cierten applications need to work in that size of ram.
test and see,
regards
Do it always right
Ken Stallings
Advisor

Re: can't allocate memory

Developer reported back that adding swap did the trick. Thanks all.
FYI, swapmem_on is set to 1 and the system doesn't seem to be using swap under normal loads. I didn't get to watch while the user ran her test though.