Linux Memory Crash

Problem Linux Memory Crash

In this blog, we will understand what happens to Linux programs if there is not enough space in the virtual memory. Instead one still has space in the RAM. Basically, this problem is also known as Linux Memory Crash. An example of the same is user issues a command and observes that the program utilizes 1MB of RAM and 1000MB of video memory. If the user’s PC only has 128MB RAM and 512MB virtual memory, will this program crash?

 

 

Solution

The explanation of the above question is given below. Virtual memory is not actually necessary if one has adequate RAM. When a user runs out of actual memory, virtual memory is the only thing that can be used.

The system uses that memory for another purpose after writing some RAM to virtual memory (disc). When necessary, that virtual memory is loaded back into the physical memory. Apart from that it also may require writing some other memory to virtual memory to free some memory up for that).

 

Depending on how the system is set up, it may be able to tell someone how the memory has been assigned to them. It would be beneficial, but if the user never touches the memory, it will never be allocated, whether it is real or virtual.

 

As a result, if the program truly utilizes 1MB RES + 1000MB VIRT. It cannot fit into less than 1001MB of memory (either virtual or real). However, if the system over-promises RAM and never actually allows it to the program. The program may continue to run until it exhausts all available memory.

 

 

Also Read: Combine PDFs via Python

 

 

Share this post

One thought on “Linux Memory Crash

Leave a Reply

Your email address will not be published. Required fields are marked *