System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

swap problem: not enough memory: not using 'reserve'???

 
SOLVED
Go to solution
llagos
Occasional Advisor

swap problem: not enough memory: not using 'reserve'???

Hi... hpux 11.31... swapinfo -tam looks like:

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 0 8192 0% 0 - 1 /dev/vg00/lvol2
reserve - 8192 -8192
memory 5825 5774 51 99%
total 14017 13966 51 100% - 0 -
#

Strange I have memory=99% while dev is 0%...!

Of course, I have lots of memory problems (exec, fork, not enough memory, etc.).

may it be hpux is NOT using my 'reserve' area (swap, right?) at all? Only RAM?

Regards,

Leo
11 REPLIES
Tim Nelson
Honored Contributor
Solution

Re: swap problem: not enough memory: not using 'reserve'???

my belief,

dev will not show usage until something is swapped there.

memory is full so nothing can swap yet.

hpux reserves swap on process startup, if there is no more memory to start a process and no addition swapspace to pre-reserve for that process then no need to swap any old processes out....

if you add more dev swap space I would suspect that you will then see "dev" usage.

anyone reading can feel free to correct me, swap sometimes seems to be a elusive discussion (at least to me).
llagos
Occasional Advisor

Re: swap problem: not enough memory: not using 'reserve'???

Thanks Tim...

problem is that swap went to 100% and instead of swapping, it just gave errors of "not enough memory"...

Really this swap subject on hp-ux is quite picky...

Why doesn't it swap after, let's say, 80%?

Regards,
likid0
Honored Contributor

Re: swap problem: not enough memory: not using 'reserve'???

Looks like you need to add more swap, how much physicall memory does the server have?

your problem is with reserving memory for starting processes, not actuall physical memory preasure,

you have your 8 gigs if the lvol device and the 5825 megs of the pseudo-swap full, so you can't start new processes.

add more swap
Windows?, no thanks
llagos
Occasional Advisor

Re: swap problem: not enough memory: not using 'reserve'???

Thanks Daniel,

Physical is:

clrtmpds:/ # dmesg | grep Physical
Physical: 6270124 Kbytes, lockable: 3922724 Kbytes, available: 4531720 Kbytes
clrtmpds:/ #
llagos
Occasional Advisor

Re: swap problem: not enough memory: not using 'reserve'???

Appreciate your answers, but then again, I'm not following this swapinfo then...

swapinfo says 'reserve' area (my partition swap, 8GB) is 0% USED... so why do I need to add more, if the current one is NOT used???

Or is there a process which is requesting MORE than 8GB at startup???

In syslog I also found:

clrtmpds:/ # grep swap /var/adm/syslog/syslog.log
Aug 6 14:09:00 clrtmpds vmunix: Deferred swap reservation failure pid: 10998
Aug 6 14:15:00 clrtmpds vmunix: Deferred swap reservation failure pid: 11160
clrtmpds:/ #

Thanks for any clarification...

Leo
Don Morris_1
Honored Contributor

Re: swap problem: not enough memory: not using 'reserve'???

No it doesn't. It says your actual device space is 0% used, but 100% reserved. And since the memory swap is 99% consumed for used/reservation, that's why you're down to 51Mb of available swap reservation space. Any new allocations (like starting a process or processes) that need more than 51Mb would be getting the ENOMEM when they try malloc() or fork() or other virtual address allocations that aren't backed elsewhere [files or whatnot].

The swap space would only be used if the system actually needed to write pages out to it. The reservation comes into play whenever virtual memory that isn't backed by other means is allocated (not RAM, just the virtual memory such as doing a malloc(). Even if you never touch the addresses returned, there's still swap reserved for it).

The deferred swap reservation failures are from processes trying to relax the restriction (configured for lazy swap). If this is an IPF system, the process main thread stacks are lazy swap by default [so in other words, the processes may not have been chatr'd or otherwise set for lazy swap -- this is simply how stacks are grown on IPF ]. When lazy swap is used, the reservation is held off until physical memory is actually wanted -- the downside being that if there isn't any swap, you have to fail in a page fault which doesn't give a clean error/backout path like failing a system call such as malloc(). The failure path is to get a SIGSEGV instead which usually means the process is killed.

Don Morris_1
Honored Contributor

Re: swap problem: not enough memory: not using 'reserve'???

I probably didn't explain that as clearly as I'd like -- and rather than type things again, this older thread has pretty much the same issue [reservation exhaustion with no actual swap consumption, still free memory]:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1136195

Hopefully reading that will help clear things up.

Re: swap problem: not enough memory: not using 'reserve'???

>not using 'reserve'?

The reserve line is a bookkeeping entry and it always indicates "used":
TYPE AVAIL USED FREE
dev 8192 0 8192
reserve - 8192 -8192

So reserved never has any AVAIL and has negative free.

>may it be HP-UX is NOT using my 'reserve' area (swap, right?) at all?

reserve isn't an area; device or filesystem swap is. And you have reserved all of your device swap.

>swapinfo says 'reserve' area (my partition swap, 8GB) is 0% USED

It says "dev" is 0%. (I would suggest you don't use the same word "reserve" that means something different than the word "reserve" that is listed in swapinfo(1m).)

>Or is there a process which is requesting MORE than 8GB at startup?

Well, the sum of all of your processes has reserved 14 Gb during their execution.

>Don: which doesn't give a clean error/backout path like failing a system call such as malloc(). The failure path is to get a SIGSEGV instead which usually means the process is killed.

You could attempt to abort more gracefully with sigaltstack(2) and a signal handler.
muruganantham raju
Valued Contributor

Re: swap problem: not enough memory: not using 'reserve'???

Hi,
8192Mb of the device swap area is completely reserved by the processes. But the reserved memory is not being utilized by the processes and hece the dev (USED %) is 0.
That means 8192Mb of memory is reserved (locked) by the processes and can not be available for any other processes though the reserved space is not being utilized.

may it be hpux is NOT using my 'reserve' area (swap, right?) at all?

No. your system is infact utilizing the swap memory. Hence it utilizes 5774Mb of memory swap and reserved 8192Mb of device swap.

You can monitor which of the running processes is occupying the memory and drill down to further before coming to any conclusion.
Regards,
Muru
llagos
Occasional Advisor

Re: swap problem: not enough memory: not using 'reserve'???

Thanks Everybody... very confusing, seeing the amount of similar posts, this pseudo-swap thing. Reserving versus Using.

Got it clear now.. Added 12GB more of swap, and now the box is happily running.

Again, thanks!

Leo
llagos
Occasional Advisor

Re: swap problem: not enough memory: not using 'reserve'???

Thanks.