Solved

Page Fault? and Current Processors.

Posted on 1998-08-08
23
633 Views
Last Modified: 2010-04-26
An interrupt that occurs when a program requests data that is not currently in virtual memory. The interrupt triggers the operating system to fetch the data from a storage device and load it into RAM.

This is the definition of Page Fault. Actually I need an example of such error (Beginners example). What happens in the currently available processors when page fault occurs? or Do they have any solution for page faults?
0
Comment
Question by:masif
  • 10
  • 8
  • 4
  • +1
23 Comments
 

Author Comment

by:masif
ID: 1122488
Adjusted points to 100
0
 
LVL 6

Expert Comment

by:joe_massimino
ID: 1122489
Actually, there are many ways to get a Page Fault, and there is no sure fire way to fix it because the cause can be so many things from corrupt files to improper handling of data.  The fix can be very difficult to find, or very simple. In the case of a corrupt file, such as a Word Doc. or Excel Spread Sheet, you could clear the page fault by deleting ot repairing the file. In some cases you could fix the trouble by exporting the spread sheet or Doc file to another file, leaving the corruption behind in the origianl file. There are so many references to Page Faults throughout Tech-Net in so many products that it is difficult to give you one solution. I believe this to be as close to an answer as you will get. Page Faults are a very large topic.
0
 
LVL 6

Expert Comment

by:joe_massimino
ID: 1122490
Could you give me some feedback on this?  I wanted to point out that there are far too many ways to get a Page Fault, and far too many ways to fix them to list one as if it were the definitive answer.
0
 
LVL 32

Expert Comment

by:jhance
ID: 1122491
I think you are misinterpreting the function of a page fault as an error.  A modern "virtual memory" CPU is designed to create page faults so that the operating system can support programs which require more than the amount of physical RAM to operate.  Unlike MSDOS, Win95, NT, unix, and OS/2 require a CPU which supports virtual memory or VM.  VM is a technique where the amount of memory space available to the running program is not limited by the amount of RAM installed on the system.  It does this by using a part of the hard drive space as "memory".  When a "page" of memory is needed by the program which is not in real memory, a page fault is generated and the OS has a chance to load the page from disk into RAM and then return control to the program.  The drawback to this is performance, it takes orders of magnitude longer times to load a page from disk than to get it from RAM.  Of course, part of the trick for an OS designer is to make the best possible use of real RAM and to use a "smart" algorithm for loading/saving pages to disk.

The bottom line is that page faults are not errors in that they cause your system to crash.  They are to be avoided whenever possible by careful program design because they run slower but most (if not all) current program wouldn't run without them.
0
 

Author Comment

by:masif
ID: 1122492
Actually I know that there are too may ways to get page faults and there are too many ways to fix them, but the solution that I want is purely Hardware related, or CPU related. It has no concern with Windows 95, NT or other OS only a general solution with respect to hardware. I think I have some clue about that somebody told me that it has some relation with Processor Tolerance, but I've searched all the internet but couldn't found a solution.
0
 
LVL 32

Expert Comment

by:jhance
ID: 1122493
What are you talking about????
0
 
LVL 32

Expert Comment

by:jhance
ID: 1122494
Just to review, you asked:

Q1: What happens in the currently available processors when page fault occurs?

A1: When a "page" of memory is needed by the program which is not in real memory, a page fault is generated and the OS has a chance to load the page from disk into RAM and then return control to the program.  

Q2: Do they have any solution for page faults?

A2: Add enough RAM to the system so that no page faults occur.
0
 
LVL 32

Expert Comment

by:jhance
ID: 1122495

 
Just to review, you asked:

Q1: What happens in the currently available processors when page fault occurs?

A1: When a "page" of memory is needed by the program which is not in real memory, a page fault is generated and the OS has a chance to load the page from disk into RAM and then return control to the program.  

Q2: Do they have any solution for page faults?

A2: Add enough RAM to the system so that no page faults occur.
 

0
 
LVL 6

Expert Comment

by:joe_massimino
ID: 1122496
I disagree with the statement that adding more RAM will discourage Page Faults.  it is poor programming, file corruption, and a poor software installation which causes the vast majority of Page Faults. What I mean by software installation is that mixing versions of software which were not designed to work together, .dll versions being one. Installing older versions of software into a system which contains newer versions of software.  The .dll dilemma is only one facet of Page Faults, and a host of other errors.

If you search Microsoft's KB you will see many Page Faults which crash a program, and the suggested solution is to contact the product vendor, not install more RAM. However, I will agree that not having enough RAM can cause a host of errors which will go away with the additon of RAM, but it will not cure every Page Fault.


0
 

Author Comment

by:masif
ID: 1122497
If more RAM is not the solution for every page fault then there is some way to minimize such errors with other hardware modifications, may be some modifications in CPU will minimize page faults as I've said in my question that What happens in the currently available processors (Intel MMX, Pentium Pro, Pentium II) when page fault occurs (Do they have some special kind of memory management systems or internal cache that minimize the page faults?)
0
 
LVL 32

Expert Comment

by:jhance
ID: 1122498
joe_massimino,

Are we talking about the same thing?  You seem to be talking about MS Windows errors or "faults" which occur as a result of system or software problems.  I interpret the question to be of the general topic of page faults as they apply to virtual memory computer systems of all types.  I'll continue to stand by my point that the rate of page faults occuring is most directly related to the amount of physical memory available to the system.  To quantify this, you can use the relation:

PF Rate = K * D/M, where K is some constant value, D is a variable that represents the demand for virtual memory, and M is the available physical memory.

As you can see, as M becomes smaller, the page fault rate goes up.  For very small values of M, the PF Rate becomes very large and the system essentially stops working.  A properly designed operating system (and I don't include Windows 95 as one of these) will not crash under these circumstances but will merely be unable to perform any user processing due to the large overhead of performing paging.  For large values of M, even programs which demand large amounts of memory will generate few page faults and their entire working set of memory can be located in physical memory.  
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 6

Expert Comment

by:joe_massimino
ID: 1122499
You are suggesting that every PC will have Page Faults if the conditions relational to the amount of Ram available are met. I say no, this is not correct. Page Faults are a result of software, not of hardware.  You could take the same PC I am using now and install Linux on it, then install XWindows with a load of applications and what happened to the Page Faults, or anything that resembles a page fault.  Here are a few exerts from Microsoft.
---------------------------------------------------------------
The real problem is that memory is allocated for several applications. The allocation is done by the first application. When this applicationterminates, it takes with it all of its memory. This means that each time the remaining applications try to access this memory, an error occurs. Symptoms include data corruption, hanging, or the WIN32S16.DLL page fault mentioned above.
-------------------------------------------------------
In response to a page fault caused by a Non-Microsoft application
Microsft says: " The third-party product discussed in this article is manufactured by a vendor independent of Microsoft; we make no warranty, implied or otherwise, regarding this product's performance or reliability."
---------------------------------------------------------------

In the many articles published by Microsoft on Page Faults, they occur because of Software drivers, incorrect .dcom, or .dll's, but they NEVER, EVER say to put more ram in the sytem.


0
 
LVL 32

Expert Comment

by:jhance
ID: 1122500
joe,

Again, you are relating a MS specific problem to computer architecture in general.  Page Faults, demand paging, and virtual memory are GENERIC to computer systems and have nothing in particular to do with Microsoft.  I'd suggest an excellent text on the subject might be "Computer Architecture - A Quantitative Approach" by Hennessy & Patterson.  Chapter 8 deals with memory system design and covers paging and page faults in some details.  It's interesting how they can discuss such a topic without ever mentioning MS Windows.

On the topic of linux, I think you should check your information before stating that linux doesn't page fault.  As a matter fact, it page faults nicely.  If you examine /proc/stat on a running linux system, you can even track the page fault rate in real time.
0
 

Author Comment

by:masif
ID: 1122501
Mr. Jhance comment is very close to my question's answer, actually I am talking Page Faults in terms of Computer Architecture and Virtual Memory. But at the same time I would say that Page Faults occurs in Muti-tasking enviroment like Windows 95 & NT or Unix (I am only known to these Multi-tasking OS may be there are more) in Multi-tasking enviroment when page fault occurs the OS tries to fetch the data from the secondary storage and load it to RAM and after that the program executes normally, but when OS couldn't find the data at all then that particular program crashes and this situation is called Invalid Page Fault, the other programs run normally . Whereas in single tasking enviroment like MS-Dos (maybe there are other single tasking OS I don't know) when page fault occurs the same thing happened the OS tries to locate that page in the secondary storage and load it in to RAM and program executes normally but when that page didn't exists or Invalid page fault occurs the whole system hangs or crashes and the result we have to reset or reboot our system.
0
 
LVL 32

Expert Comment

by:jhance
ID: 1122502
An invalid page fault is caused under a protected mode operating system as a result of a program trying to access a memory address which is not owned by the program.  Since that access is illegal (under the rules of the host operating system), the system doesn't fetch the request data for the program but rather terminates the offending program to prevent a security problem.  This is first of all a hardware function in the memory management unit which has a flag for each page of memory that a program is permitted to access.  Under MSDOS, there is no such protection and therefore an "true" invalid page fault cannot occur.  What happens under MSDOS is that programs will often overwrite the MSDOS memory locations or program itself and then the system will crash since the operating system has been corrupted.
0
 

Author Comment

by:masif
ID: 1122503
You are talking about the Page Fault in terms of OS again, as we've discussed that we are not bound to OS's.
0
 

Author Comment

by:masif
ID: 1122504
You are talking about the Page Fault in terms of OS again, as we've discussed that we are not bound to OS's.
0
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
ID: 1122505
Just to review, you asked:

Q1: What happens in the currently available processors when page fault occurs?

A1: When a "page" of memory is needed by the program which is not in real memory, a page fault is generated and the OS has a chance to load the page from disk into RAM and then return control to the program.    

Q2: Do they have any solution for page faults?

A2: Add enough RAM to the system so that no page faults occur. Use a non-virtual memory operating system (like MSDOS) and no page-faults will occur.
0
 
LVL 32

Expert Comment

by:jhance
ID: 1122506
You really can't separate the operation of a page fault from the operating system.  Under the hardware, a page fault is treated just like an interrupt.  Control is taken from the running process and another is started.  Any action taken, however, must be initiated by the host operating system.  Otherwise you just get an unhandled interrupt exception.
0
 

Expert Comment

by:pbatton
ID: 1122507
Most of the above answers are very technical and being just a hobbyist I don't speak the techno language that well, but here is my experience.  When I first upgraded to Pentium and installed RAM on the motherboard, I got page faults at an alarming rate.  It was very annoying.  I searched the newsgroups for info on this and found advice about using only matched pairs of RAM - I won't pretend to know all the reasons, but using unmatched pairs of RAM evidently caused my page faults.  First I used matched pairs, but not all the same brand on the board and still encountered page faults.  I've learned since that Tyan boards are or were pretty sensitive to this issue.  To make a very long story short, after putting all the exact same brand of RAM on the board, my page faults became history.  I was having at least 10 a day and haven't had one since the day I changed my RAM to major on a major all the same brand.  For me I have no doubts that the mismatched RAM was causing my page faults, this may not be the answer for everyone's page faults, but it was for me.  
0
 

Author Comment

by:masif
ID: 1122508
I don't agree that adding more RAM is not the solution of the page faults. Also I think that MS-Dos is not a Non-Virtual Memory Operatig system. I need some feed back on it.

0
 

Author Comment

by:masif
ID: 1122509
Sorry, the above comment has errors actually I don't agree that adding more RAM is the solution of the page faults. Also I think that MS-Dos is not a Non-Virtual Memory Operatig system. I need some feed back on it.

0
 
LVL 32

Expert Comment

by:jhance
ID: 1122510
It still seems like you're not "hearing" what I'm saying.  Page Faults are _NORMAL_ on any system which uses a hardware MMU (memory management unit) (examples: 80386, 486, Pentium, MC68020/030/040, SPARC, PowerPC, MIPS, HP/PA-RISC, and many others) coupled with a virtual-memory demand paged operating system (like Win95/98, NT, unix, linux, OS/2, Solaris).  While PFs are NORMAL, is is normally desired to MINIMIZE them as they cause a performance hit due to the use of hard disk to store things vs. RAM.  There are many things that can be done to reduce PFs, restructure the program, modify the virtual-memory page size, change the paging algorithms, etc.  Some of these remedies are available to the system (i.e. hardware) designer, others are available to the operating system designer, others are available to the application software designer.  Very few options are left to the end-user of the hardware/OS/application.  

My point is that _AS AN END-USER OF A COMPUTER SYSTEM, WITH A COMMERCIAL OS, USING COMMERCIAL OFF-THE-SHELF APPLICATION SOFTWARE, THERE IS LITTLE YOU CAN DO TO CHANGE PAGE FAULTS OTHER THAN TO ADD MORE MAIN MEMORY (i.e. RAM) SO THAT THE NEED TO PAGE DATA IN/OUT IS REDUCED_.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this article you will get to know about pros and cons of storage drives HDD, SSD and SSHD.
What do we know about Legacy Video Conferencing? - Full IT support needed! - Complicated systems at outrageous prices! - Intense training required! Highfive believes we need to embrace a new alternative.
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now