views:

47

answers:

1

I'm getting hundreds of these process_reaper threads that build up over time in my application. Anyone have any idea what these may be? They seem to be in my use of Runtime.exec() however I'm destroying my process in a finally statement but they still show up

screen shot: http://www.dropmocks.com/mBxM5

Process proc = null;
        String line;
        try {
            logger.info("Trying to execute command " + Arrays.asList(command).toString().replace(",", ""));
            proc = Runtime.getRuntime().exec(command);

        } catch (IOException e) {
            logger.info("IOException while trying to execute " + command);
            return false;
        } finally {
            if(proc != null) {
                proc.destroy();
            }
    }
+1  A: 

I haven't seen this one myself so I searched a little; it seems a process reaper is related to the Linux kernel process management and is a daemon thread. It maintains the process state so that resources can be freed/released/collected on process termination and so on. This resource might help you. There is a mention on reapers in the final parts.

Sagar V
thanks for the link, reading now, any idea how to get rid of them?
From your screen-shot it seems they are being disposed off. Anyway they are required since you are spawning a separate process using Runtime.exec(). I'm not too sure how to get rid of them since I haven't seen them myself :-)
Sagar V
AH! thanks Sagar, that tipped me off, I closed and restarted visual VM and the threads were gone, so yes they are being cleaned up. thanks :)
you are welcome! :)
Sagar V