Can you try pmap on your process? (Early and late). It may help us figure
where the memory is being used.
Paul Alfille
On Fri, Mar 20, 2009 at 9:42 AM, david schumacher <davids...@web.de> wrote:
> hi,
>
> thanx for your answer!
>
> directly after starting owfs the usage is about 1Mb. it is running for
> 10 hours now (only writing to DS2413, no reading), and its above 600Mb
> rss, increasing slowly.
>
> i tested to use some more ram (400Mb) using a small program, it seems
> owfs really uses that amount:
>
> top says directly before freezing for some minutes (a.out tries to use
> 400Mb, more ram than available):
> --snip--
> r...@piano:/opt/1wire# top -d2c
> top - 13:31:05 up 2 days, 17:07, 5 users, load average: 0.10, 0.09, 0.10
> Tasks: 206 total, 1 running, 205 sleeping, 0 stopped, 0 zombie
> Cpu(s): 3.2%us, 18.5%sy, 0.0%ni, 0.0%id, 77.9%wa, 0.0%hi, 0.4%si,
> 0.0%st
> Mem: 2057224k total, 2042512k used, 14712k free, 220k buffers
> Swap: 0k total, 0k used, 0k free, 21116k cached
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+
> COMMAND
>
> 14286 root 20 0 644m 533m 664 S 7.5 26.5 33:15.99
> ./owfs/bin/owfs -uall
> 1wire
> 639 root 20 0 403m 369m 320 D 19.9 18.4 0:00.80 ./a.out
> 400
>
> 28096 david 20 0 400m 109m 2984 S 0.0 5.5 3:00.25
> gnome-terminal
>
> 11601 david 20 0 535m 94m 3936 S 0.0 4.7 1:43.13
> /usr/lib/firefox-3.0.7/firefox
> (..)
> --snap--
>
> ...after some minutes a.out was killed by the kernel and the machine was
> responsive again.
>
> another thing:
> since i added two more sensors, most of the time the devices are missing
> from the mounted directory, sometimes they come back for some seconds or
> minutes.
>
> the scripts writing and reading the files are still able to control and
> read the 1wire-devices, if the scripts are started while the directories
> are existing.
>
> i noticed this behaviour already with 5 devices connected, but it went
> away when i connected the sensors to external power instead of parasytic
> mode.
>
> the whole cable from the DS9490R to the last sensor is about 30cm long
> (unshielded).
>
> listings of the vanishing and re-appearing device-directories:
>
> --snip--
> r...@piano:/opt/1wire# ls -laht
> total 4,0K
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 .
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 bus.0
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 settings
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 statistics
> drwxr-xr-x 1 root root 30 2009-03-19 23:31 structure
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 system
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 uncached
> drwxr-xr-x 5 root root 4,0K 2009-03-18 19:56 ..
> --snap--
>
> ...some seconds / minutes later ...:
>
> --snip--
> r...@piano:/opt/1wire# ls -laht
> total 4,0K
> drwxrwxrwx 1 root root 8 2009-03-20 13:20 01.A89AB9120000
> drwxrwxrwx 1 root root 8 2009-03-20 13:20 01.EE75B9120000
> drwxrwxrwx 1 root root 8 2009-03-20 13:20 10.1B099C010800
> drwxrwxrwx 1 root root 8 2009-03-20 13:20 10.353E9C010800
> drwxrwxrwx 1 root root 8 2009-03-20 13:20 10.748570010800
> drwxrwxrwx 1 root root 8 2009-03-20 13:20 10.9C199C010800
> drwxrwxrwx 1 root root 8 2009-03-20 13:20 3A.1EDA01000000
> drwxrwxrwx 1 root root 8 2009-03-20 13:20 81.6C492C000000
> drwxrwxrwx 1 root root 8 2009-03-20 13:20 simultaneous
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 .
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 alarm
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 bus.0
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 settings
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 statistics
> drwxr-xr-x 1 root root 30 2009-03-19 23:31 structure
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 system
> drwxr-xr-x 1 root root 8 2009-03-19 23:31 uncached
> drwxr-xr-x 5 root root 4,0K 2009-03-18 19:56 ..
> --snap--
>
> i read something about periodic re-scanning for bus-masters like DS9490,
> maybe this affects the presence of the directories?
>
> maybe i should use owperl to avoid the fuse-stuff..
> i planned to use perl for managing the files on the owfs-mount, so its
> no big difference in programming to use owperl...
>
> david
>
> Paul Alfille schrieb:
> > Hi David,
> >
> > 1. Memory: That memory consuption sounds excessive (there is very
> > little memory used by owfgs -- less than 1 MB. It's sometimes hard to
> > tell what actual memory consumption is under linux -- the system
> > doesn't scavenge allocated memory until it's needed. We've tested owfs
> > under valgrind for memory leaks, but it's always possible.
> >
> > 2. owperl vs shell script. This is more a matter of convenience. Shell
> > scripts have a modest start/stop penalty while the owperl can run an
> > internal loop. owperl doesn't need the file system (FUSE). You can
> > configure a bunch of ways:
> > A. owfs/FUSE and shell cat/echo/...
> > B. owfs/FUSE and perl file read/write
> > C. owserver and owshell (owget/owwrite/owdir)
> > D. owserver and OWNet.pm (perl)
> > E. owserver and 'owperl -s 4304'
> > F. owperl: OWIinit('-u')
> > Personally, if I wanted the extra flexibility of a perl program (to
> > remember values, do calculations, etc) I'd probable do "D" above. If I
> > liked shell scripting, I'd choose "A" or "C"
> >
> > 3. Temperature reading pause. It turns out that during a temperature
> > reading, even with external power, the DS18X20 cannot tolerate other
> > bus activity. If your temperature values don't change quickly, you can
> > increase the "volatile" cache time to incur the reading penalty less
> > frequently (giving stale data, perhaps).
> > Anoth approach is to add a separate bus master, and a put the
> > temperature sensors on a separate bus. owfs will happily aggregate the
> > two, and not stall the switches for temperature readings.
> >
> > Paul Alfille
> >
> > On Fri, Mar 20, 2009 at 6:47 AM, david schumacher <davids...@web.de
> > <mailto:davids...@web.de>> wrote:
> >
> > hello together!
> >
> > this is my first post to this list.
> >
> > i stumbled upon owfs (great stuff, thanks!) while searching a
> > simple way
> > to measure and control temperatures.
> >
> > i am using DS9490R (bus master) with two DS18S20 (thermo), two DS2401
> > (serial) and one DS2413 (two channel switch) for testing.
> >
> > after running this shellscript 24 hours (heavily switching the
> > DS2413):
> >
> > --snip--
> > r...@piano:/opt/1wire/uncached/3A.1EDA01000000# while true; do
> > echo 1,1
> > > PIO.ALL; echo 0,1 > PIO.ALL; echo 1,0 > PIO.ALL; echo 0,0 >
> > PIO.ALL;
> > echo -n x ; done
> > --snap--
> >
> > and this in parallel (reading cached temperatures from DS18S20):
> >
> > --snip--
> > r...@piano:/opt/1wire# while true; do echo $(date +%s; echo -n "
> > "; cat
> > 10.353E9C010800/temperature) >> /var/tmp/10.353E9C010800.temperature;
> > echo $(date +%s; echo -n " "; cat 10.748570010800/temperature) >>
> > /var/tmp/10.748570010800.temperature; sleep 8; done
> > --snap--
> >
> > the memory consumption of owfs was about 955Mb virt / 816Mb res, and
> > still growing.
> >
> > owfs was mounted using: r...@piano:/opt# ./owfs/bin/owfs -uall 1wire
> > owfs and libow version is 2.7p17 .
> > configure-flags: --enable-owperl --enable-debian
> > kernel: 2.6.27-11-generic #1 SMP Thu Jan 29 19:28:32 UTC 2009 x86_64
> > (ubuntu 8.10 amd64)
> >
> > did i make a mistake, or is there a problem in owfs?
> >
> > by the way: do you recommend me to use owperl instead of owfs when
> > stability is the main concern?
> >
> > another ting:
> > is there a possibility (in the 1wire-protocol in general and with
> > owfs)
> > to avoid the "blocking" of the whole bus for all other
> > communication for
> > one second while sampling temperatures using DS18S20?
> >
> > im thinking of "please start sampling, i will ask for the result
> > later".
> >
> > this would be very nice when for example switching a heater via
> > onewire
> > while using the same bus with many slow sensors.
> >
> > thanks a lot for your patience ;)
> >
> > greetings from germany,
> > david
> >
> >
> ------------------------------------------------------------------------------
> > Apps built with the Adobe(R) Flex(R) framework and Flex
> > Builder(TM) are
> > powering Web 2.0 with engaging, cross-platform capabilities.
> > Quickly and
> > easily build your RIAs with Flex Builder, the Eclipse(TM)based
> > development
> > software that enables intelligent coding and step-through debugging.
> > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> > _______________________________________________
> > Owfs-developers mailing list
> > Owfs-developers@lists.sourceforge.net
> > <mailto:Owfs-developers@lists.sourceforge.net>
> > https://lists.sourceforge.net/lists/listinfo/owfs-developers
> >
> >
> > ------------------------------------------------------------------------
> >
> >
> ------------------------------------------------------------------------------
> > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> > easily build your RIAs with Flex Builder, the Eclipse(TM)based
> development
> > software that enables intelligent coding and step-through debugging.
> > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Owfs-developers mailing list
> > Owfs-developers@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/owfs-developers
> >
>
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Owfs-developers mailing list
> Owfs-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers