|
From: Leif M. <le...@ta...> - 2004-05-13 19:00:32
|
It is actually normal on Linux platforms for Java to be displayed as a
series of
processes. You will see the same thing if you run your application as
a standalone
application without using the Wrapper. If you look at the PPID (Parent
PID) of
each process you can see how they are each spawned.
Try the following command. It will make it clearer where each process comes
from.
ps -fax
Cheers,
Leif
bha...@us... wrote:
>When i use the wrapper 3.1 on Linux (Debian 2.2.20 and Redhat7.3) i can see 12 java processes :
>PID PPID Process
>346 345 /usr/java/bin/java ...
>347 346 /usr/java/bin/java ...
>349 347 /usr/java/bin/java ...
>350 347 /usr/java/bin/java ...
>351 347 /usr/java/bin/java ...
>352 347 /usr/java/bin/java ...
>353 347 /usr/java/bin/java ...
>354 347 /usr/java/bin/java ...
>355 347 /usr/java/bin/java ...
>356 347 /usr/java/bin/java ...
>357 347 /usr/java/bin/java ...
>358 347 /usr/java/bin/java ...
>
>Is this normal ? If yes why ?
>
>public class app implements Runnable{
>boolean ok=true;
> public app(String[] args) {
> }
> public void run(){
> System.out.println("Newrun");
> ok=true;
> while (ok){
> System.out.println("Alive");
> try {
> Thread.sleep(2000);
> } catch (InterruptedException e) {
> System.out.println("Interruption");
> }
> }
> }
>
> public void start() {
>
> }
> public void stop() {
> ok=false;
> }
>}
>
>
>import org.tanukisoftware.wrapper.WrapperManager;
>import org.tanukisoftware.wrapper.WrapperListener;
>
>public class serv
> implements WrapperListener
>{
> private app m_app;
>
> /*---------------------------------------------------------------
> * Constructors
> *-------------------------------------------------------------*/
> private serv()
> { System.out.println("new"); }
>
> /*---------------------------------------------------------------
> * WrapperListener Methods
> *-------------------------------------------------------------*/
> public Integer start( String[] args )
> {
> System.out.println("start");
>
> Thread th;
> m_app = new app( args );
> th = new Thread(m_app);
> th.start();
>
> return null;
> }
>
> public int stop( int exitCode )
> {
> System.out.println("stop");
>
> m_app.stop();
>
> return exitCode;
> }
>
> public void controlEvent( int event )
> {
> System.out.println("control event "+event);
> if (WrapperManager.isControlledByNativeWrapper()) {
> // The Wrapper will take care of this event
> } else {
> if ((event == WrapperManager.WRAPPER_CTRL_C_EVENT) ||
> (event == WrapperManager.WRAPPER_CTRL_CLOSE_EVENT) ||
> (event == WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT)){
> WrapperManager.stop(0);
> }
> }
> }
>
> /*---------------------------------------------------------------
> * Main Method
> *-------------------------------------------------------------*/
> public static void main( String[] args )
> {
> System.out.println("main ");
> WrapperManager.start( new serv(), args );
> }
>}
>
>
|