tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: resource leak in linux emulation?



2014-04-03 11:57 GMT+02:00 Mark Davies <mark%ecs.vuw.ac.nz@localhost>:
> Note that nprocs (2nd to last value in the /proc/loadavg output)
> increments every time javac runs until it hits maxproc.

You're right, the problem appears when the last thead alive in a
multithreaded linux process is not the main thread, but one of the
children. This only happens with when using the linux emulation,
because is the only case when LWPs have their own respective PIDs.

To fix, this should be added somewhere, probably at
sys/kern/kern_exit.c:487 (but I'm not sure if there's a better
location):

        if ((l->l_pflag & LP_PIDLID) != 0 && l->l_lid != p->p_pid) {
                proc_free_pid(l->l_lid);
        }

Sergio.
.


Home | Main Index | Thread Index | Old Index