Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a process_reaper thread in Java?

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();
            }
    }
like image 710
James Avatar asked Oct 01 '10 00:10

James


People also ask

What is a reaper thread?

The reaper is a background thread with which ticks every minute and calls registered objects to allow reaping of old session data.

What are the two types of thread in Java?

Java offers two types of threads: user threads and daemon threads. User threads are high-priority threads. The JVM will wait for any user thread to complete its task before terminating it.

What is a thread in Java?

A thread in Java is the direction or path that is taken while a program is being executed. Generally, all the programs have at least one thread, known as the main thread, that is provided by the JVM or Java Virtual Machine at the starting of the program's execution.


1 Answers

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.

like image 84
Sagar V Avatar answered Nov 15 '22 00:11

Sagar V