- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: paging in, paging out
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2000 09:29 AM
тАО09-07-2000 09:29 AM
Does 'in' and 'out' refer to a direction: IN to physical memory and OUT to swap?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2000 09:37 AM
тАО09-07-2000 09:37 AM
Re: paging in, paging out
and the system needs to swap memory images to disk.
Even though you have free memory, the systems are paging because the
user's applications are using memory mapped files. These files are
created using the mmap(), munmap(), and msync() system calls. These
system calls actually bypass the file system and avoid the buffer cache
to enhance their performance in reading and writing to disk. Normal
calls, such as read() and write(), read and write to the file systems
via the buffers, like the buffer cache. This causes intermediate steps
in the read() (or writing with write()), which are reading from the disk
to the buffer and then writing from the buffer to the memory (reversed
for the write() function).
When writing to the memory mapped files, the virtual memory subsystem
pages them out to disk, which is in effect writing them. This process
resembles swap paging, but is really not due to memory pressure. In
essence, the memory mapped files use the kernel's paging function to
write data to the disk.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2000 09:38 AM
тАО09-07-2000 09:38 AM
Re: paging in, paging out
and the system needs to swap memory images to disk.
Even though you have free memory, the systems are paging because the
user's applications are using memory mapped files. These files are
created using the mmap(), munmap(), and msync() system calls. These
system calls actually bypass the file system and avoid the buffer cache
to enhance their performance in reading and writing to disk. Normal
calls, such as read() and write(), read and write to the file systems
via the buffers, like the buffer cache. This causes intermediate steps
in the read() (or writing with write()), which are reading from the disk
to the buffer and then writing from the buffer to the memory (reversed
for the write() function).
When writing to the memory mapped files, the virtual memory subsystem
pages them out to disk, which is in effect writing them. This process
resembles swap paging, but is really not due to memory pressure. In
essence, the memory mapped files use the kernel's paging function to
write data to the disk.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2000 09:38 AM
тАО09-07-2000 09:38 AM
Re: paging in, paging out
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2000 10:09 AM
тАО09-07-2000 10:09 AM
Re: paging in, paging out
The paging thresholds are (lotsfree- 1/8 of freemem; desfree- 1/16 of freemem; and minfree- 1/4 of desfree). Lotsfree and desfree are upper and lower bound free memory. Minfree is minimal amount of free memory tolerable. If free memory drops below this boundary, system is desperate for memory and deactivation processes starts.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2000 10:21 AM
тАО09-07-2000 10:21 AM
Re: paging in, paging out
Examples of segment types are
'data' (where variables are kept and of course can be altered)
'text' (program code which is read only)
'stack' (a speciaal type of data segment)
Pages are 'paged in' to memory from disk (program file or swap space) when they are required to be executed (text) or read or altered (data). Not all the pages that make up the process need to be in memory at once and indeed process memory can far exceed physical memory.
The pages of a process that are in memory are known as the 'Resident Set' and the whole process is known as the 'Virtual Set'.
When a process is started, a reasonable amount of its text and data pages will be paged into memory. As it runs, further pages will be required. If a page is required that is not in memory, a 'page fault' occurs and HP-UX arranges for that page (and probably others around it) to be paged in. This will continue and if a process continues to do similar things, a stable resident set will tend to remain in memory.
If there is plenty of real memory, all well and good. Resident sets will increase until some sort of stability occurs.
If memory is short, HP-UX has to discard some pages belonging to one process in order to page in those required for another. If these are text (read only) pages then they are simply disacarsded and overwritten - they can be paged in again later from the program file. If data and they have been modified then they have to be paged out to a swap file. This is bad because writes take a long time.
Thus paging in is a normal occurrence of a virtual memory system although obtaining a stable resident set for all processes is desirable and paging out is bad.
I hope this makes some sort of sense and is of some use to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2000 12:03 PM
тАО09-07-2000 12:03 PM
Re: paging in, paging out
I think the kernel (pun intended) of truth in the "good" vs. "bad" is that to page-ins may first require page-outs to create free memory. Thus to do work (page-in/good) we first need to do other work (page-out)/bad).
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2000 05:24 AM
тАО09-08-2000 05:24 AM
Re: paging in, paging out
Is 'paging in' ANY reading into memory (eg process starting up), or only SWAP activity reading into memory (including text from program file)?
'Paging out' is moving memory areas belonging to a process to swap space.
Once pages are 'paged out', can they be swapped 'in' multiple times (page out once, page in many)? Of course only if they are not altered.
If you are lucky enough that nothing is 'paged out', there just isn't anything to 'page in', right?
Both 'paging in' and 'paging out' involves disk activity (assuming we are not using pseudo swap yet), so both are slowing the machine down.
'Paging out' is worse because it is a write activity, which takes longer.
It is really bad, if 'paging out' happens because the swapper is trying to page something 'in' and does not have the memory for it. Then 'paging out' would happen frequently, not just once when a process starts up.
Please comment, or correct me if I have got it wrong. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2000 05:45 AM
тАО09-08-2000 05:45 AM
SolutionOnce paged out, pages can be paged in many times. If they are data pages and have not been amended then they can just be discarded. If modified then they have to be paged out if the mmory that they occupy is required for some other process.
If you have plenty of memory, no swap space will be used (HP-UX will reserve swap space for data segments). You will still get paging in because of processes starting etc.
Paging out only happens when you are short of memory. It doesn't happen as a matter of course when a process starts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2000 06:39 AM
тАО09-08-2000 06:39 AM
Re: paging in, paging out
As I pointed out earlier, if free memory drops below minfree value, that means system is desperate for memory and deactivation processes starts i.e paging out.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2000 08:11 AM
тАО09-08-2000 08:11 AM
Re: paging in, paging out
You wrote:
"Is 'paging in' ANY reading into memory (eg process starting up), or only SWAP activity reading into memory (including text from program file)?"
You must think of the concept of paging from the respect of a facility of the kernel called the Memory Management Subsystem (MMS). I think because you have no reference point, this is confusing to you. The MMS will see ALL memory (physical and virtual) as an entire pool of memory. The MMS decides how to effectively use this pool of memory. To do this it sets up mappings when the program is compiled that map the many parts of a process between physical memory and virtual memory. This mapping gives the MMS everything it needs in order to find the pages a program needs to run.
Now, a program can only run in physical memory and not virtual memory as you know. When a program runs, the kernel will start off in "user" mode and the instructions will start to execute. When the program tries to find a page that is not in physical memory, a "page fault" occurs and the kernel will switch to "system" mode and use the maps I mentioned above to find the page. When it finds it, it looks for a free page in physical memory to load it. (Remember, in physical memory, a page is either free or used. A free page is not mapped to a virtual address and a used page is mapped to a virtual address.) If it does not find a free page in which to load it, kernel will moves used pages out to virtual memory to make room, hence the term "page-out". The kernel then "pages-in" the page needed, switches back to user mode and the process executes again this time finding what it needs. This is all done by the MMS dynamically.
"'Paging out' is moving memory areas belonging to a process to swap space. "
Yes. So that there is room for pages that need to be paged-in.
"Once pages are 'paged out', can they be swapped 'in' multiple times (page out once, page in many)? Of course only if they are not altered."
Remember your reference point - the MMS. The MMS will use this pool of memory as efficiently as possible to keep programs running. Pages are always "out" unless they are needed. They will be paged-in when they are needed. Remember, "demand paging".
"If you are lucky enough that nothing is 'paged out', there just isn't anything to 'page in', right? "
Not true. Unless your physical memory is large enough to have every page of every process in it, the MMS will have to page-in.
"Both 'paging in' and 'paging out' involves disk activity (assuming we are not using pseudo swap yet), so both are slowing the machine down."
UNIX is designed to run many more processes than the system has room to fit into physical memory. This is the beauty of UNIX.
"'Paging out' is worse because it is a write activity, which takes longer."
More acurately, paging out is not good because it is an indication of memory pressure.
"It is really bad, if 'paging out' happens because the swapper is trying to page something 'in' and does not have the memory for it."
Paging out ONLY happens when the MMS is trying to page something 'in' and does not have the physical memory for it.
"Then 'paging out' would happen frequently, not just once when a process starts up. "
Paging out will happen as many times as seen fit by the MMS to keep processes running.
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2001 10:59 AM
тАО05-24-2001 10:59 AM
Re: paging in, paging out
I have read a couple of posts concerning memory management and the "variables" LOTSFREE, DESFREE, etc. I am loading 11.0 and get an error during "configurable parameters" that include errors with these settings. My question is, how do you access/change these settings?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2001 11:22 AM
тАО05-24-2001 11:22 AM
Re: paging in, paging out
Frankly, they _should_ be 0 -- that tells the kernel to just figure out good values based on available physical memory at boot.
What errors are you seeing, by the way? Something like lotsfree greater than freemem? (In other words someone just set it way too high?)
By the way -- regarding an earlier comment, the system does _not_ begin paging out when memory falls below MINFREE - it starts when free physical pages falls below LOTSFREE.
Here's a quick synopsis:
Exactly how the steal hand treats the pages still marked as unused depends on the comparison of free system physical memory and three tunables: LOTSFREE, DESFREE, and MINFREE. If freemem > LOTSFREE, the steal hand actually does nothing. There's lots of memory still available on the system, so why chance moving a page to swap space that might be needed soon? In the more common case, when DESFREE< freemem < LOTSFREE, pages are 'stolen' or moved from physical memory to swap space. When MINFREE < freemem < DESFREE, system memory is getting more critical and the steal hand steals pages and puts low priority processes to sleep, increasing the
likelihood for stealing their pages on the next pass. Finally, when freemem < MINFREE the system memory need is critical and the steal hand begins deactivating processes to completely free their memory.