0
$\begingroup$

As much I know about a memory and storing data there would always be a managing type feature in every memory which manages all the data and its location. So, what is the file system of a RAM. I also like to know the format or type (mp3, pdf, png, txt, jpg or binary) of data stored in.

$\endgroup$
  • 6
    $\begingroup$ Data in RAM isn't composed of files, so it's not organized in a file system. The format is whatever format the program is using. $\endgroup$ – David Richerby Nov 29 '15 at 10:48
  • $\begingroup$ @DavidRicherby The operating system manages the RAM, so perhaps something can be said beyond what you wrote. $\endgroup$ – Yuval Filmus Nov 29 '15 at 11:14
  • 1
    $\begingroup$ File system is not only responsible for management of directory structure. Its main task is the allocation of file data in the form of blocks into the Disk as well as how files would be opened, closed, read from disk and written to disk etc. In the case of RAM, there is no need of opening, closing, reading from disk and even writing to disk. So I think there would be no need of a file system in RAM particularly. As far as file format is concerned, file system has no role in it. File format is only handled by underlying application. Any new format of file can be stored in existing file system. $\endgroup$ – user3606704 Nov 29 '15 at 12:01
  • $\begingroup$ @user3606704 A running application writes and reads its data from ram and to the ram (during loading of app and after), which can be said as processing data. So, there would be something. $\endgroup$ – Vivek Ji Nov 29 '15 at 12:54
3
$\begingroup$

Think of the file system and its files as a big cabinet with lots of physical folders in an office of bureaucrats. The sheets in the folders are arranged in fixed ways such that every bureaucrat knows exactly where to expect which information before taking the folder out of the cabinet.

Not let us assume that a bureaucrat (a program) performs a certain operation on a folder/file. It will take the folder to the desk, spread the sheets on the desk, cut certain things out, glue them together, paint marking son certain sheets, translates the text of a sheet to a new one, discards sheets entirely, add sheets, and do all kinds of crazy stuff on the data on the desk in the way that the bureaucrat wants it to do. After all that, the bureaucrat puts the relevant sheets nicely back into the folder such that everything is orderly, puts the folder back into the cabinet and then throw everything that is left on the desk back into the trash bin.

Note that the bureaucrat's desk is the RAM in this analogy. Now how are things stored on the desk? Well, that depends on what precise step the bureaucrat performs at a time instant. Even more, different bureaucrats doing essentially the same task may do things in a different order. So we can't really say anything about the organization of a bureaucrat's/program's desk/RAM other than whatever is put back into the cabinet/file system is put there orderly. In between, it is up to the bureaucrat how things are stored and in which encoding.

For most data in the RAM, the question how it is encoded does however make sense. However, this encoding can change frequently. For example, when a web browser receives text from a server, it may change the encoding multiple times before the data is actually displayed.


I hope that this analogy helps clearing things up. It has its limits, though, as in a computer, folders are not taken out of the cabinet, but they are rather copied and later overwritten, as this is cheaper in a computer than it is in real life. Also, because the memory sizes of the processes in a computer are not fixed, there is memory management going on, and one can say something about where memory allocation information is stored and how that information is encoded.

$\endgroup$
  • $\begingroup$ So, what is format of processing data in ram? $\endgroup$ – Vivek Ji Nov 30 '15 at 16:14
  • $\begingroup$ @VivekJi The format is whatever the program you are currently executing deems to be appropriate. Your question is like asking how things are arranged on a kitchen table - at every point in time, there is some kind of order, but how things are arranged depends so strongly on what someone is doing are doing at the moment and who is doing that so that no universal answer can be given. $\endgroup$ – DCTLib Dec 1 '15 at 8:57
  • $\begingroup$ @VivekJi: the file format is known as core, and it's quite useless to you unless you want to attach a debugger to it. $\endgroup$ – Joshua Mar 4 '16 at 18:06
  • $\begingroup$ @Joshua " the file format is known as core" No it isn't. That's like saying that the file format of a piece of paper is "ink". Memory isn't a file. It doesn't have a file format. $\endgroup$ – David Richerby Mar 6 '16 at 0:57
  • $\begingroup$ But there is a file format known as core; it's the debugger crash dump format. Oh gee it just happens to match the process's memory map layout, holes and all. $\endgroup$ – Joshua Mar 6 '16 at 2:19
1
$\begingroup$

The equivalent to a file system for RAM would be the MMU (memory management unit)

Back in the day many systems didn't have one and poorly written programs would crash each other or the OS by violating each others address space. As technology progressed some processors offered additional MMU chips and eventually they were integrated into the processors that we have today. The MMU with the OS work to give programs an address block to load and run in. They keep track of the address blocks programs use via paging tables. They also handle fragmentation of memory blocks that have been freed.

As for how data is handled inside a programs memory space, that is left up to the programmer, though high level languages have developed best practices on how to handle memory.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.