Operating System - HP-UX
1833838 Members
2350 Online
110063 Solutions
New Discussion

Re: Not allowing a process to swap from physical mem to swap

 
SOLVED
Go to solution
Clifton Smith
Occasional Advisor

Not allowing a process to swap from physical mem to swap

We are running HP-UX 11.11 and an Oracle-based application. One of the processes seems to be very susceptible to hangs when any of its subprocesses page out to swap memory. Is there any way by using nice or some other parameter to "lock" a process and its child processes in physical memory so that they don't page out to swap?
10 REPLIES 10
Tomek Gryszkiewicz
Trusted Contributor

Re: Not allowing a process to swap from physical mem to swap

I do not think you can do it. The only way is to set up swap in memory..

-Tomek
John Carr_2
Honored Contributor

Re: Not allowing a process to swap from physical mem to swap

I think the application would need to changed to do this.

:-) John.
Mark Grant
Honored Contributor
Solution

Re: Not allowing a process to swap from physical mem to swap

I don't think this is possible either and I don't think it would be a very good thing to do. If a process were not swappable you could find yourself in a situation when things ran out of memory and very important processes would not be able to run. You could well trash your system.

Best thing is to have enough RAM so that you don't need to swap
Never preceed any demonstration with anything more predictive than "watch this"
G. Vrijhoeven
Honored Contributor

Re: Not allowing a process to swap from physical mem to swap

Hi,

It can only be done in the code i think. It needs to alocate lockable memory. This memory cannot be swaped out.

What you can do is install PRM v >2. You can configure memory usage and "CAPPING" by a PRM group. Check http://docs.hp.com for PRM configuration.

Hope this will help,

Gideon
Don Morris_1
Honored Contributor

Re: Not allowing a process to swap from physical mem to swap

Within the process itself it could use mlock(2) or plock(2)... but I don't know of any command or interface outside of the process that would do that for an arbitrary process.
Jeff Schussele
Honored Contributor

Re: Not allowing a process to swap from physical mem to swap

Clifton,

I believe you need to look up the
plock() & mlock()
system calls.

Do a
man 2 plock or mlock
for further details.

HTH.
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
doug mielke
Respected Contributor

Re: Not allowing a process to swap from physical mem to swap

Isn't there an Oracle concept of 'pinning' into memory? I don't know how it's done, but I thought I'd run across it before.
I'll check an Oracle manual.
Claudio Cilloni
Honored Contributor

Re: Not allowing a process to swap from physical mem to swap

Maybe you have other not-so-necessary applications/processes running that take a lot of memory; closing them or reducing their memory needs could reduce the paging activity.

Ciao
Claudio
doug mielke
Respected Contributor

Re: Not allowing a process to swap from physical mem to swap

I didn't find any doc, but our DBA tells me that you can 'pin' an object, ie: package body, tablespace, etc, imnto memory, and it's set in the database start scripts. He did't think a process could be, but any Oracle object may.

Hope this helps.
Alex Ostapenko
Advisor

Re: Not allowing a process to swap from physical mem to swap

Are you sure that the problem is that the subprocess is hanging because it was paged out? HP-UX has a very robust virtual memory management system and paging mechanism, and I don't think that HP-UX would cause a process to hang just because of its normal memory management.

The process could have hung, therefore not be runnable, and then have been paged out as other runnable processes needed memory. But when you examined it, it's already paged out so it appears that it hung because of paging out. You may have the timeline reversed here: subprocess hangs, then it gets paged out.

Just a thought...

=:-) Alex