> Hi guys,
> 
> I've memory leaks in my program and findleaks dcmd can't catch! My program 
spawns over than 100 solaris threads, join them and this is done infinitely 
every 30 seconds. I'm trying to find the root cause of the problem but 
findleaks 
doesn't help much. Do you know any other mdb useful commands to lead me in the 
root cause?
> 

Are you using libumem ? ::findleaks relies on that being present.

Also, ::findleaks doesn't report something as "leaked" if there's
still a reference to it (but you're not using it anymore). I.e.
something like:

void mythread(void)
{
        char *buf = malloc(1024);
        ...
        while (1) {
                ...
                /*  main work here - never use "buf" */
        }
        /* never free buf */
}


        ...
        thr_create(NULL, 0, (void *)mythread, ...);

wouldn't be caught.

::umausers could also come in handy. It shows what codepaths allocated
how much memory - whether "leaked" in the sense that ::findleaks would
report, or still-referenced (but possibly still forgotten by the app
in the scope it's currently operating in).


Best wishes,
FrankH.


Reply via email to