How to run with low priority Eclipse on Windows?

I run programs from Eclipse (on Windows) that often use CPU time. To avoid linking my entire machine, I set Low priority with Task Manager. However, this is a cumbersome manual process. Is there a way that Eclipse can automatically set this priority?

EDIT: I realized that each particular launcher (Java, Python, etc.) has its own customization method, so I will limit this question to the Java domain that I need most.

+6
java eclipse taskmanager
source share
8 answers

I assume that you run these programs using external tools. If so, then you can modify the start command to use the start /low hack described earlier. However, if these applications have a special type of launch (for example, a Java application or similar), you are having problems. The only way you could change this is to open the Eclipse source, find this type of startup and send out jobs, and then change it to use start /low . Sorry, but I don’t think this is a simple solution.

+2
source share

I have the same problem for Windows - running subprocesses that use all processors (thread-parallel jobs), but I want to have good responsiveness in the Windows development environment.

Solution : after starting several tasks:

DOS cmd β†’ wmic process where name="javaw.exe" CALL setpriority "below normal"

No, this will not affect the eclipse.exe process.

Java Solution . Paste this code into your intensive programs to lower your own Windows priority.

 public static void lowerMyProcessPriority() throws IOException { String pid = ManagementFactory.getRuntimeMXBean().getName(); int p = pid.indexOf("@"); if (p > 0) pid = pid.substring(0,p); String cmd = "wmic process where processid=<pid> CALL setpriority".replace("<pid>", pid); List<String> ls = new ArrayList<>(Arrays.asList(cmd.split(" "))); ls.add("\"below normal\""); ProcessBuilder pb = new ProcessBuilder(ls); pb.start(); } 

Yes, verified. Powered by Win7.

+2
source share

A better alternative is to configure the amount of memory that Eclipse will use: http://www.eclipsezone.com/eclipse/forums/t61618.html

And do a Google search for the -Xmx and -Xms options for the JVM (which you can configure for runners inside Eclipse).

Yours faithfully

0
source share

I spent some time ago to research this. There is no way inside Java to lower priority (as far as I could see), so you need to use a start / min approach. I did not try to get this work to work.

Instead, I got a multi-core processor. This gives room for other things, even if the Java program runs on the same core.

Highly recommended.

0
source share

I would also like to do this, it is strange that this is impossible, really. I know that you can set thread priorities, but I think that in windows-land, threads are all scheduled "inside" the process priority, so to speak.

0
source share

I ran into the same issue on Linux and found this: http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workaround.html

An interesting bit on how to convert Java thread priorities to OS priorities. This solved the problem for me, it can help too.

0
source share

Use the OS tool or the fake java.exe file to fix the really long javaw.exe command that runs in the eclipse splash screen.

Bypass eclipse.exe and run javaw.exe directly.

Once you run javaw.exe directly and correctly.

START / BELOWNORMAL \ path \ javaw.exe many parameters for loading-work

0
source share

If you need it only in development, you can set the priority of all other processes to a high level ...

-4
source share

All Articles