5 ms·
Let's say you have 8GB of RAM and are watching a HD video which is 7GB uncompressed and the rest of your system only really needs 1GB of your RAM, surely it mak
by randallsquared 15y ago
Let's say you have 8GB of RAM and are watching a HD video which is 7GB uncompressed and the rest of your system only really needs 1GB of your RAM, surely it makes sense what whilst you are watching the video you can use spare CPU cores to uncompress the rest of the video and put it into RAM.
That's not clear to me. Why do something ahead of time that can be done faster than needed on the fly anyway? You're basically assuming that when system resources are needed for something else halfway through your video, processing power will be more useful than space.
- jiggy2011 15y agoTrue , with video decompression that is probably the case. I'm sure there are lots of examples where doing complex calculations whenever you have CPU spare and swapping them out to disk as needed would be preferable to having to contend with whatever else needs to use it at the time. I think the key is how to OS deals with memory contention issues rather than just minimizing memory usage. Someone with a better understanding of OSes than me could probably clarify. I guess the performance hit is when you write a page of RAM to the disk, perhaps there are some cases where you don't bother to do this if memory contention is high?
- keeperofdakeys 15y agoReally, you don't want to randomly waste cpu cycles for nothing, like pre-decompresssing video. It just increases the power usage and heat of the computer. It would also make it harder to skip, since the program needs to finish the portion it is working on. One thing people often don't realise is there isn't really 'wasted' RAM, your OS usually uses the rest to cache things, especially files. File caching can greatly speed up disc reads and writes. (The following only applies to linux, I'm not sure about other OS's; all three have very different memory models). When memory is getting high, a few things can happen (depending on whether you have swap). The file cache is preferentially cleared first, but swapping pages to disc is also considered readily. An interesting thing is that swapped pages aren't deleted from swap straight away, only if they are modified (so swap usually doesn't decrease in size). There is also the Out Of Memory killer, which can kill applications using too much memory. It really is an interesting area. You can read more from this page http://tldp.org/LDP/tlk/mm/memory.html http://tldp.org/LDP/tlk/mm/memory.html. Just remember all OS's are different.
- m_for_monkey 15y agoThat example isn't really good, but think back to the original post: if your browser caches every element of every already rendered page, it can be super fast in case of a page reload/tab reopen.
- sp332 15y agoIf you can spin up the HD, read the file into RAM, and spin down the HD, it will take a lot less energy than reading the file slowly over the course of an hour.
- Klinky 15y agoSpinning down the hard drive is a pretty bad idea as it doesn't save much power & there is usually a noticeable lag to spinning it back up again. Also most applications & OSes these days expect it to be always on. Your carefully crafted scenario goes up in smoke if your OS likes to log stuff, your browser wants to dump it's cache or your word processor wants to autosave.