There are two types of memory in the computer system you need to know about to understand how the application software is installed and how to execute/run them.
The Central Processing Unit (CPU) has access only to the main memory from which it can read the software which needs to be executed. All the application softwares which are installed on the computer system are stored in the Secondary memory.
This memory is referred to as Random Access Memory (RAM). It stores data electronically using the transistors as switches with their ON and OFF states representing the 1 and 0 respectively.
Loading Process Initiation: The loading process begins when the user or the operating system initiates the execution of the application. This could be through clicking an icon, running a command, or some other form of user interaction.
File System Access: The operating system locates the executable file of the application on the secondary storage device (e.g., hard drive). This file contains the compiled code and resources needed to run the application.
Memory Allocation: The operating system allocates a portion of the main memory (RAM) to accommodate the application. This allocation depends on the size of the application and the availability of free memory.
Loading into Memory: The executable file of the application is loaded from secondary storage into the allocated space in the main memory (RAM). This process involves: 1. Reading the executable file from the storage device into RAM. 2. Resolving memory addresses and references within the executable file to ensure proper execution. 3. Mapping any required dynamic libraries or shared resources into memory as well.
Initialization: Once the application code and necessary resources are loaded into memory, initialization routines are executed. These routines prepare the application environment, set up initial variables, and perform any necessary setup tasks before the application starts running.
Execution: Finally, the application starts executing its main program logic. It interacts with the user or performs its intended tasks based on the instructions provided in the executable code.
Memory Management: Throughout the application’s execution, the operating system manages memory, ensuring that resources are efficiently utilized. This includes handling memory allocation, deallocation, and swapping data between main memory and secondary storage as needed to optimize performance.
Termination and Cleanup: When the application is closed or terminated, the operating system deallocates the memory space that was allocated for the application, releasing resources back for other applications or system processes.