Is whatever I see on the Internet temporarily present in the RAM?

In order to show images, text and dynamic elements of web pages all of the data you download has to be operated on by the CPU, processed, decoded and marshalled into a layout, and then pushed out to display, probably that by the GPU.

In order for those devices to do anything at all they need the data to be in RAM. The CPU might be able to use instructions to access hard disks and network devices, but the root instructions pull data from RAM into CPU caches, to then be worked on by the CPU cores.

Practically everything you do on a computer uses the RAM. Device to device DMA across PCIe might avoid RAM, but if you are looking at the end result of something then it, or at least some representation of it, went through your RAM.

For an example of what I mean by that last part look at hardware video decoding. What you see is decoded video frames, the actual video downloaded from the internet will be encoded and compressed. You download compressed video, your CPU copies it to the graphics device memory, and your graphics device decodes the frames in its own memory. Whether that memory is dedicated GPU RAM or your system RAM depends on your whether your GPU is dedicated or integrated into your CPU.


To clarify your comments, RAM has absolutely no persistence. It requires power to retain its state and is completely different from hard disk and other storage memories. I've written more about that topic over at What happens to the content of RAM when a computer turns off?


In a very literal sense, what you see on the screen (each individual graphics pixel, not text) is always stored as an image in RAM and then cyclically read from it when it is displayed 60 times a second or so. With a dedicated graphics adapter these days the RAM consists of dedicated (and faster-than-average) chips on the adapter; with integrated graphics, like on business notebooks, the graphics engine may use some of the general RAM.

In a less literal sense, it is likely that both the HTML received from the server as well as an abstract model of the web page — the result of parsing the received HTML — are in memory as well.

The interactions between RAM and hard disk on modern operating systems are both ways: The system may decide to keep parts of the hard disk contents in memory for a while ("cache" it for faster repeated access); and it may decide to "swap" data to disk which a program holds in what it thinks is "memory" because it hasn't been accessed for a while and there is more urgent data to hold.

Therefore it is, at the end of the day, not really relevant to your question whether a browser tries to hold everything in memory or not: The operating system is free to handle memory behind the applications' back the way it deems best, and on a system which is not RAM-starved it is likely that the currently displayed web page is in RAM at all three levels of abstraction.


In addition to what the previous answers mentioned, virtually anything on your hard drive was, at least at some point, also in your RAM. Writes to (and reads from) disk virtually always use what is called Direct Memory Access (DMA), where the CPU commands the DMA controller to transfer a block of memory between some device and RAM. Virtually all disk accesses on modern computers happen this way, where the CPU will issue a command to transfer blocks of data from the disk to RAM or from RAM to the disk.

With DMA transfers, the CPU just gets an interrupt when the process is complete. The reason this is done is so that the CPU is not tied up during the transfer and can be busy doing other things (or else can be sleeping and not wasting power.) Virtually all I/O and storage devices (including even the RAM, but especially the disks) are much, much slower than the CPU. While we're still talking about relatively small fractions of a second, the time it takes to transfer a block of data from RAM to a hard drive may as well be an eternity from the CPU's perspective. So, allowing the CPU to just command the process to start and get an interrupt when it's done saves tons of time that can be used for other useful purposes on the CPU.

When you loaded a webpage in your browser, the Ethernet controller would have placed the data coming from the website into your RAM, probably still in an encrypted format. From there, it would be decrypted into another RAM buffer. The browser would generally use the buffer already in RAM to display the page, but then also copies it out to disk using DMA so that it can load it from there again if it needs that resource again instead of having to download it from the Internet again.

You can also be virtually guaranteed that anything currently being displayed in your browser is also currently in RAM. In order for it to be displayed, it will be, at the very least, in its final rendered form in video RAM, though the original HTML, javascript, image files, etc. are likely also still in the main CPU RAM as long as the page is still actively open.