Setting priority of java application

Posted on 2011-10-28
Last Modified: 2012-05-12
Are there command line settings to set the priority of the javaw exe?  We would like for the java application to set the priority level for itself when starting it.

As it is, we go into task manager and right click on the javaw.exe process and then manually set the priority to High or ideally Real Time (after the application has been started).

I see this:

Obviously, this situation applies to windows only.

If not in the java code, maybe in a .bat file?
Question by:allelopath
    LVL 86

    Accepted Solution

    Make a shortcut to the Windows 'start' command. That allows you to specify priority

    start /?
    LVL 1

    Author Comment

    The start command might work.

    There is an java API called Java Service Wrapper which a Java Application to be run as a Windows Service (or a unix daemon) which allows you to set the process priority

    LVL 1

    Author Comment

    This looks like an open-source equivalent to Java Service Wrapper:
    LVL 86

    Expert Comment

    Yes, but of course the purpose of running it as a service is something different. Is that what you want to do as well?
    LVL 1

    Author Comment

    The goal is to make it run faster. What are the implications of running it as a service?

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now