markwolfe Veteran Posted February 4, 2008 Veteran Share Posted February 4, 2008 Well, my wife has been using Linux for a while now, and only one thing keeps her from using it all the time. Whenever java is called (a web app), it consumes a lot of CPU time. She can no longer use other browser tabs or apps very quickly (they are sluggish to respond). She is using Sun Java in Linux (just like in Windows), and she already uses Firefox for both OSes. It just seems that Linux sees Java asking for a lot of CPU time, so it gives it. I have manually played with the 'nice' value on the "java_vm" process when it is running, and setting it to 1 or 2 makes it much better. Java is still given plenty of time, but other activities (browse other tab, and so forth) are allowed more priority because java is being nicer now. Is there any way to force this behavior onto the app in a one-time setting? I cannot find a way, except using something like "renice", but that has to be done manually when the app is already fired up. Worst case, I guess a constantly running check to find PIDs of tasks with "java_vm" in them, and renicing them in the script would work as a second-best solution. Unfortunately, I really don't have any sort of good bash skills. I've used Linux as my OS exclusively for the past 5 years, but I am really just a user, and not much of a tinkerer, so haven't needed super skills in this area. Can anyone here help me? Link to comment Share on other sites More sharing options...
GatorV Posted February 4, 2008 Share Posted February 4, 2008 Are you using a Composited Desktop? Like using Compiz? Link to comment Share on other sites More sharing options...
markwolfe Veteran Posted February 4, 2008 Author Veteran Share Posted February 4, 2008 Unless Xubuntu did that to me by default, the answer is no. Just a regular install. This PC is not high-end, and I even switched from a "fancy" mouse cursor set to a plain-jane one because lag was noticeable. Link to comment Share on other sites More sharing options...
ichi Posted February 4, 2008 Share Posted February 4, 2008 Worst case, I guess a constantly running check to find PIDs of tasks with "java_vm" in them, and renicing them in the script would work as a second-best solution. and seems to do that. Another solution could be doing something like alias java_vm='nice -n 2 java_vm'. Not sure if this would work though, the idea is that calling java_vm would actually run it along with nice, but the browser might be calling it using the full path (or not using bash at all). Maybe renaming java_vm and setting a script with that name that launches it with a nice level? Link to comment Share on other sites More sharing options...
Borbus Posted February 5, 2008 Share Posted February 5, 2008 and seems to do that.Another solution could be doing something like alias java_vm='nice -n 2 java_vm'. Not sure if this would work though, the idea is that calling java_vm would actually run it along with nice, but the browser might be calling it using the full path (or not using bash at all). Maybe renaming java_vm and setting a script with that name that launches it with a nice level? On those lines, a better solution might be to move the java_vm executable somewhere and replace it with a bash script that does that. I'm not sure how apt would respond to that, though. Link to comment Share on other sites More sharing options...
markwolfe Veteran Posted February 5, 2008 Author Veteran Share Posted February 5, 2008 and would probably be the easiest solution. I installed it, but various other issues with Java on her machine, including not responding to keyboard input (not sure why, as Java works fine on my PC) caused her additional frustration. I, myself, gave up on figuring out what was going on with Java when both Sun Java 6 and a rollback to 5 failed to fix the keyboard problem. And the GNU implementation GCJ would not run the app at all. This experiment with her and Linux is over for the time being. She still thinks positive things about Linux, but she is more willing to deal with the Windows side for a while longer. Thanks for the help, though! Link to comment Share on other sites More sharing options...
ichi Posted February 5, 2008 Share Posted February 5, 2008 Could it be somehow related to the java 1.5 bug mentioned here? Not that it matters, if you wife has already moved back to windows... just guessing. Link to comment Share on other sites More sharing options...
Recommended Posts