Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Windows Server 2003(Enterprise, SP2).

My understanding was that any process created by a user will be terminated when the user loggs off the account. But its not happening. I login via Administrator account. Start a simple java process and logoff. But the process is not killed.

Is there any configuration for this or something?

I am mostly a software programmer and not much in to servers and so I am stuck. I found out that while logging off, 1) Win32 is supposed to send a CTRL_LOGOFF_EVENT to all processes started by that user. 2) JVM is supposed to handle this event and terminate the VM.

But I can't understand why my java process is not killed when i logoff.

Any idea!!!

share|improve this question
see if you are not passing -Xrs as a parameter to the jvm. That reduces the signals therefore ignores sighup – feniix May 3 '10 at 5:52
@feniix: there's no 'SIGHUP' in Windows. – Chris S Jun 16 '10 at 17:20
@Chris - but from a quick read, it seems like the Sun JVM does something similar on Windows if -Xrs is specified. "When the -Xrs option is used on Sun's JVM, the JVM does not install a console control handler, implying that it does not watch for or process CTRL_C_EVENT, CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, or CTRL_SHUTDOWN_EVENT. " – mfinni Jun 16 '10 at 18:19
could be user has a "disconnected" session still active - check the users tab in the task manager - this typically happens when a user RDP's in but does not log off (they just close the RDP window) – user55029 May 17 '12 at 1:53

Can you shut your process down normally w/o logging out or does it hang in that case as well? Can you instrument your code to investigate where it's getting "stuck" and whether it's getting the signal that you expect? Some of the Sysinternals process utilities link text may show what your process is doing when you expect it to terminate. Can you attach a debugger to the lingering process after you log back in again and look at what it's doing?

share|improve this answer

i had something similar happen to me a while back (not java, however), but it turned out to be that the process i couldn't stop by logging off, was actually a service running on that server.

share|improve this answer
@pacey. thanks. I know that services dont stop on logoff as they are daemon in nature, but my process is a simple java process. – Suraj Chandran Apr 22 '10 at 5:26

Probably the process is stuck and/or is not handling correctly the event.

See if this can help:

share|improve this answer
the process is not stuck, becuase i can see the logs and everything works just fine. its doing the job what it's supposed to do. – Suraj Chandran May 25 '10 at 10:44

A process will stay in memory after the system tries to terminate it if it is running some code in a driver or if another process still has an handle opened on it.
How do you check that the process is not killed ? And what is your java program doing ?

share|improve this answer
my process is an application server. i know process is not killed because i can still connect to the application server. And the process is simply running as normal – Suraj Chandran May 25 '10 at 10:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.