Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

How can I go by setting up a scheduled task that will cancel a java console that outputs a heap error and then start it up again?

I need to restart my wowza service because of some java heap allocating memory error that seems to happen every night.

I tried few options but could not get it right.

share|improve this question

You can find any number of tools to kill processes, like pskill from sysinternals/Microsoft. Write a batch file that kills the process, waits until it's gone, then restarts it. Once that's working, create a new scheduled task that runs it at a set time, making sure it fires after the heap error is certain to have occurred. The trick will be to identify the process to kill. Ref:

share|improve this answer

If it's an actual service, you can also do a

net stop <name of service>


net start <name of service>

PSkill is a great tool too.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.