Static Vs. Dynamic Loading in Operating System (OS)
Static vs Dynamic Loading
On this page we will discuss about Static Vs Dynamic Loading in operating system . The operating system loads a library of function during processing different programs. Files are brought into the memory which are needed as the processing of the programs takes place. Generally, the loading process is divided into two categories, static and dynamic loading.
Static Loading vs Dynamic Loading in Operating System
- The process can vary depending on the loading method where the loading can take place at once, or at random time. In the case of static loading, the load process doesn’t change over time, on the other hand, in the case of dynamic loading, it changes with time.
- The selection between static and dynamic loading is made by the developer who develops the operating system.
The following table represents the difference between the static and the dynamic loading.
Static Loading
In static loading the complete program is loaded to main memory before it is executed.
Dynamic Loading
To execute a process, the entire programme and all process data must be in physical memory.
As a result, the size of the process is limited by the quantity of physical memory accessible.
Head-to-head Comparison between the Static and Dynamic Loading in Operating System
Static Loading | Dynamic Loading |
---|---|
The complete program is linked and complied without dependency of an external program. | All the modules are loaded dynamically. The developer provides a reference to all of them and the rest of the work is done at execution time. |
Absolute data and program are loaded into the memory to start execution. | Loading of data and information takes bit by bit in run time. |
The linker combines the object program with other object modules to make a a single program. | The linking process takes place dynamically in relocatable form. Data is loaded into the memory only when it is needed in the program. |
The processing speed is faster as no files are updated during the processing time. | The processing speed is slower as files are uploaded at the time of processing. |
The code may or may not be executed once it is loaded into the memory. | Execution takes place only when it is required. |
Static loading is done only in the case of structured programming languages such as C. | Dynamic loading takes place in the case of object-oriented programming languages such as C++, Java, etc. |
The primary drawback is the wastage of memory since, once the code is loaded, it might or might not be executed. | The primary benefit of dynamic loading is efficient memory utilization. |
The decision of choosing the static or the dynamic loading method also depends on the size of the program. For instance, if the program is too big, its modules should be selected and loaded into the main memory as per the requirements using the dynamic loading method. On the other hand, static loading is the best option when the programs are smaller in size.
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others
Login/Signup to comment