I was not sure if this belongs in the software section or here. It has little to nothing to do with actual code. I have a complicated question about the operating system caching.
I will start with what I know: The operating system caches any file that was opened at least once if any free memory exists, to avoid going to hard disk and perform io which is expensive. Memory cache has no drawbacks because it can be emptied extremely quickly to make room for data that need it more.
Here is my hypothetical question: assume you have duplicate files, lets say you set up several instances of teamspeak server lets say or you just copied an entire game twice on your pc. You opened that software once from one directory and closed it. The files are in the OS cache now(or some of them anyway) you then opened that same software from the other directory. Does the os cache recognize that these are the same files with the same content that it already has cached or does it open them again from the new directory?
And another question about memory in general. If I open the game twice from different directories, do all the files get loaded twice in memory or can it load certain files once and use them for both?
I will start with what I know: The operating system caches any file that was opened at least once if any free memory exists, to avoid going to hard disk and perform io which is expensive. Memory cache has no drawbacks because it can be emptied extremely quickly to make room for data that need it more.
Here is my hypothetical question: assume you have duplicate files, lets say you set up several instances of teamspeak server lets say or you just copied an entire game twice on your pc. You opened that software once from one directory and closed it. The files are in the OS cache now(or some of them anyway) you then opened that same software from the other directory. Does the os cache recognize that these are the same files with the same content that it already has cached or does it open them again from the new directory?
And another question about memory in general. If I open the game twice from different directories, do all the files get loaded twice in memory or can it load certain files once and use them for both?