From: William M. B. <wb...@mm...> - 2006-06-25 05:06:47
|
Hi all, Just thought I'd join in on the discussion. I'm afraid there is some confusion over the term "SWAP" which is used in the "top" display. It's not measuring the usage of the swapfile, but rather showing what portion of the task's total address space (VIRT) is not currently in physical memory. This would certainly include any portion of the task which has been "swapped out" to disk, but it *also* includes all of the task's code, as well as all of the library code. You may remember that, since all the code is "read-only", it never needs to be "swapped out" to disk, but rather can be discarded, then later re-read from the program diskfile. There is a little better explanation of all this at http://www.linuxforums.org/misc/using_top_more_efficiently_3.html Bill aaron barrus wrote: > Hi Peter, > > Yes, I'm expecting that it will require some actual coding. All I want > motion to do is record the image when motion occurs. I have a seperate > process that splits them into events and compiles videos for each one. I > am using the latest motion compiled just a few days ago by myself. There > must be a counter mismatch for the VIRT to list 3.051 - it must be a > mistake since the swap file is unused. Oh well... > > I added the other columns you mentioned. I'm not familiar with what all > of the columns mean. But it looks like motion thinks it's swapped out > 2.8 gig. But top says swap has only 192k used for the whole system. I'm > looking at this because sometimes the motion daemon dies with the message > "cannot allocate XXX bytes of memory". Grrr... I'd expect the overall > memory footprint to be small since I'm not doing any pre or post > buffering or minimum_frames (all set to zero). > > top - 12:19:25 up 5 days, 3:33, 2 users, load average: 1.38, 1.36, > 1.46 > Tasks: 103 total, 1 running, 101 sleeping, 0 stopped, 1 zombie > Cpu(s): 3.2% us, 2.0% sy, 21.9% ni, 70.9% id, 1.2% wa, 0.0% hi, 0.8% > si > Mem: 2074908k total, 1222112k used, 852796k free, 221732k buffers > Swap: 2088416k total, 192k used, 2088224k free, 533308k cached > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP CODE > DATA COMMAND > 17366 root 25 9 3065m 202m 1032 S 46.6 10.0 1219:41 2.8g 136 > 3.0g motion > > > ----- Original Message ---- > From: Peter Smith <pet...@ut...> > >> > That is an interesting problem. I'm really not that much of a developer > of Motion, but I can say that to have Motion look at a camera with > timing in terms of seconds-per-frame rather than frames-per-second would > ultimately require some coding. Are you recording motion movies, images, > or just timelapse images (image every X seconds etc?) Also, which > specific version of Motion are you using, and did you compile it > yourself? It is weird that your "VIRT" is 3.051GB with only 1.1GB RAM > being used in the system. You might try adding a few extra columns to > TOP if you can (SWAP, CODE, DATA.) Here is how my system looks (~18 > webcams, ~2-5fps.) > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP CODE DATA COMMAND > 27024 root 16 0 564m 153m 1304 S 67.9 3.8 1023:28 410m 140 558m motion > > [root@linux ~]# free > total used free shared buffers cached > Mem: 4151308 4127980 23328 0 40392 3722068 > -/+ buffers/cache: 365520 3785788 > Swap: 140287572 160 140287412 > > It may be that it *is* using CPU while it is busy getting camera images, > but the overall memory footprint is small since it probably doesn't have > to keep many images around to make movies with. It has many threads > running, so that probably ramps up your LOAD, but as far as memory use, > it may be minimal. > > > Thanks, > Peter |