Hi,

I have a issue with owfs and can't figure out what to do. I created an
raspberry pi 2 process that runs on startup and collects data from 1-wire
network. What happened is that process just stops at some point. Scratching
my head why and after a couple of days, figured out that my process "eats"
more and more memory so looks like, in some point, it just terminates.
After eliminating all I ended up with only this:
#include <stdio.h>
#include <stdlib.h>
#include <owcapi.h>
#include <assert.h>
#include <signal.h>
#include <pthread.h>


volatile sig_atomic_t stop;

void inthand(int signum) {
    stop = 1;
}

void *repeating_fnc(void *var){
                char *buf;
        size_t s;
        int i;
        char** tokens;

                while (!stop){
                           OW_get("/",&buf,&s);
                }
}

int main(int argc, char **argv)
{
        signal(SIGINT, inthand);
        OW_init("--usb=all");
        pthread_t inc_thread;
        int dummy=0;
        if(pthread_create(&inc_thread, NULL, repeating_fnc, &dummy)) {

                fprintf(stderr, "Error creating thread\n");
                return 1;

        }

        while(!stop);

        if(pthread_join(inc_thread, NULL)) {

                fprintf(stderr, "Error joining thread\n");
                return 2;

        }
        printf("exiting\n");

        OW_finish();
        return 0;
} // main

and this also consumes memory like crazy (i used top to see that and %MEM
goes by 0.1% up every 10 to 15 seconds! Also VIRT and RES are going up: RES
a little faster than VIRT). I am using Dallas Semiconductor DS1490F 2-in-1
Fob, 1-Wire adapter as USB to 1-wire. Owfs is version 3.1p1.
What might be the cause of this behavior? What can I do to solve this
problem?

Kind regards,
Gabrijel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to