?
Solved

Setting priority of java application

Posted on 2011-10-28
5
Medium Priority
?
243 Views
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:
http://download.cnet.com/Prio-Priority-Saver/3000-18501_4-146904.html

Obviously, this situation applies to windows only.

If not in the java code, maybe in a .bat file?
0
Comment
Question by:allelopath
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 37045112
Make a shortcut to the Windows 'start' command. That allows you to specify priority

start /?
0
 
LVL 1

Author Comment

by:allelopath
ID: 37045231
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
http://wrapper.tanukisoftware.com/doc/english/prop-ntservice-process-priority.html

0
 
LVL 1

Author Comment

by:allelopath
ID: 37045289
This looks like an open-source equivalent to Java Service Wrapper:
http://launch4j.sourceforge.net/
0
 
LVL 86

Expert Comment

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

Author Comment

by:allelopath
ID: 37060438
The goal is to make it run faster. What are the implications of running it as a service?
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 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