What If There Is A Memory Leak In Virtual Environment?

Viewed 670

What I understood from reading some web articles is that just like any other program, the host OS allocates X amount of memory to virtual OS and when I start any program on virtual OS, the virtual OS fetches the exact amount of memory needed for the program.

When I shut the virtual OS down, it returns the allocated memory to the host OS.

But what happens if there is a memory leakage in the virtual OS environment? I am starting to learn C, and my professor says that in dynamic memory allocation operations, permanent leakage can happen in the host OS.

But what if it happens in virtual environment? I guess the program will give back ALL of the memory allocated to the host OS when I shut it down, right? What happens when I start the virtual host again the next time? Does the memory leakage show up there permanently?

Just getting afraid before I even start writing my first program in C.

P. S. If I use websites like Repl.it and use memory allocation over there, will it cause damage to my system still?

2 Answers
Related