From: Krisztian P. <mo...@no...> - 2005-03-06 20:34:45
|
hi, could someone please tell me how much memory an uml consumes if the temp dir for the unlinked temp files is on tmpfs? for example does a 64M uml use 2*64 megs of ram this way? thanks, Krisztian PIFKO |
From: Jim C. <ji...@ma...> - 2005-03-08 04:28:52
|
On Sun, 6 Mar 2005, Krisztian PIFKO wrote: > could someone please tell me how much memory an uml consumes > if the temp dir for the unlinked temp files is on tmpfs? > > for example does a 64M uml use 2*64 megs of ram this way? My UML is configured with 120 MB simulated RAM. Host and guest have kernel 2.6.8, with SKAS on the host. I made the UML hog the CPU plus do a lot of I/O and then ran "top", which says: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 13191 jimc 17 0 123m 92m 122m S 89.7 36.9 0:56.64 linux 13196 jimc 15 0 392 80 392 T 6.3 0.0 0:13.30 linux After all that, "df" on the tmpfs filesystem with the image file indicates that it occupies 96.4 MB. So definitely the memory is not allocated twice. My understanding is that tmpfs allocates an I/O page for the data just as if it had been read/written to disc, but it wasn't. Then the user (UML) maps (not copies) that page into its own address space. I imagine that the 31 MB difference between the virtual address space and the resident set (nearly equal to the image size) is occupied by 2.95 MB of UML kernel and the program text of various system daemons and their shared libraries, mapped from the host's file that's attached to /dev/ubda. James F. Carter Voice 310 825 2897 FAX 310 206 6673 UCLA-Mathnet; 6115 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA 90095-1555 Email: ji...@ma... http://www.math.ucla.edu/~jimc (q.v. for PGP key) |
From: Blaisorblade <bla...@ya...> - 2005-03-09 16:08:43
|
On Tuesday 08 March 2005 05:28, Jim Carter wrote: > On Sun, 6 Mar 2005, Krisztian PIFKO wrote: > > could someone please tell me how much memory an uml consumes > > if the temp dir for the unlinked temp files is on tmpfs? > > The rest of your answer, Jim, is ok. > I imagine that the 31 MB difference between the virtual address space and > the resident set (nearly equal to the image size) is occupied by 2.95 MB of > UML kernel and the program text of various system daemons and their shared > libraries, mapped from the host's file that's attached to /dev/ubda. Not necessarily - it can even be space mmap'ed from the tmpfs file which has not yet been written to. In fact when UML boots my SlackWare it uses just a few megs on tmpfs (and/or on RSS) but the VIRT space is the full allocated one. -- Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 http://www.user-mode-linux.org/~blaisorblade |
From: Blaisorblade <bla...@ya...> - 2005-03-09 16:04:34
|
On Sunday 06 March 2005 21:34, Krisztian PIFKO wrote: > hi, > > could someone please tell me how much memory an uml consumes > if the temp dir for the unlinked temp files is on tmpfs? > > for example does a 64M uml use 2*64 megs of ram this way? No, just 64M... at least, this is what I remember from tmpfs code (that is what really matters, UML is not at all special about this). If you have any evidence against this, post it. (Remember to look careful at "free" output, and to read the free man page). > thanks, > Krisztian PIFKO -- Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 http://www.user-mode-linux.org/~blaisorblade |