search
HomeCommon ProblemWhat is the principle of program locality?

The principle of locality of the program means that the program shows locality rules when executed, that is, within a period of time, the execution of the entire program is limited to a certain part of the program; accordingly, the storage space accessed by the execution It is also limited to a certain memory area; the principle of locality is also expressed as "temporal locality" and "space locality".

What is the principle of program locality?

#The operating environment of this article: Windows 10 system, Dell G3 computer.

What is the principle of locality of program?

The principle of locality of the program means that the program shows locality rules when executed, that is, within a period of time, the execution of the entire program is limited to a certain part of the program. Correspondingly, the storage space accessed by execution is also limited to a certain memory area. The principle of locality is also expressed as: locality in time and locality in space. Temporal locality means that if an instruction in the program is once executed, the instruction may be executed again soon; if some data is accessed, the data may be accessed again soon. Spatial locality means that once a program accesses a certain storage unit, its nearby storage units will also be accessed soon after.

Principle of locality of program:

In addition, based on the theory of locality of program, Denning proposed the working set theory. The so-called working set refers to the set of pages that are frequently accessed when the process is running. Obviously we know that as long as the working set of the program is concentrated in the memory, the number of page faults of the process can be greatly reduced; otherwise, the process will frequently have page fault interruptions during the running process, resulting in frequent page transfer in/out phenomena. , resulting in a decrease in system performance and even "jitter".

The working set can be divided by two methods: fixed time or fixed length page. When thrashing occurs, it indicates that the system load is too large, and processor balancing scheduling is usually used. The other is to control the page fault rate. When the page fault rate reaches the upper limit, the memory allocation amount is increased; when the page fault rate reaches the lower limit, the memory allocation amount is reduced.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What is the principle of program locality?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.