Erich Titl wrote: >Natanael Copa wrote: > > >>Are you really sure about that? I am not really familiar with how the >>tmpfs or ramfs works, but to me sounds logical that when you execute >>something on a tmpfs dist, the memory is never copied from ramdisk to >>RAM, because it is already in ram. It should be possible to run it from >>1 single copy in RAM. >> >> > >If this is true, then the entire idea is wrong. I doubt though, because >the program loader does more than just make a copy of the executable. It >needs to dynamically link to libraries, e.t.c. I am not sure it meddles >with the intricacies of a file system. > >
I dont have time for reading about memory management in Linux right now, but AFAIK the executables and libraries are mmap'ed. So the executable is not read into physical RAM until the memory page is touched. Also the dynamic libraries shares the memory so there should not be more than one copy of the executable libray in RAM anyway. So I believe that a shared library on a tmpfs exist only once in RAM. Even if you fork a process, there will only be 1 copy in RAM - until you write to that memory page. (google on "copy-on-write") It would really not make any sense to copy a mmap'ed executable from RAM to another place in RAM, but as I said, I'm not 100% sure about that and currently I dont have time to investigate it (so, strictly I should have kept my muth shut, but now its to late anyway...:) >>But if you run it from a mounted loopdevice in ram, the code needs to be >>uncompressed and then executed. That means you will need a copy of the >>compressed code and one copy of the uncompressed. >> >> > >True, but see above, maybe someone can shed a light on this. One thing >is sure, if you compress the binary it needs to be uncompressed before >execution. > > http://google.com/search?q=linux+memory+management is probably a good start. -- Natanael Copa ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ leaf-devel mailing list leaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/leaf-devel