Bombadil
|
 |
«
Posted
2004-10-28 05:33:26 » |
|
Java 1.5.0 causes most other PC tasks including the mouse on my Win2000 box to pause for some seconds regularly, whenever Java performs some CPU or IO intensive task. (Can't tell the exact reason so far). In such cases, read: frequently, the taskmanager's CPU load icon on the systray goes 100% and most other PC tasks are being paused for 1-3 seconds. Even the mouse pointer can't be moved! This happens oftently, for example every time I compile (with JBuilder), start a Java app like JEdit or my own projects, etc.
Older JVMs (inlcuding 1.42) don't do this on the same PC. Also other native tasks don't pause the PC. So I'm wondering how Java 1.5 can hog the system that much?
|
|
|
|
Middy
Junior Devvie  
Java games rock!
|
 |
«
Reply #1 - Posted
2004-10-28 06:29:59 » |
|
What tasks would it be?.. looking at the description its impossible to guess whats going on...
|
When do I get my makeMyGameAsILike() extension?
|
|
|
Bombadil
|
 |
«
Reply #2 - Posted
2004-10-28 06:41:26 » |
|
What tasks would it be?.. looking at the description its impossible to guess whats going on... When I start JEdit, for example. Or when I start JBuilder. Or when I hit the compile button in any JBuilder project. Or when I start my OpenGL game project which loads and binds many textures. In all the cases the CPU load goes 100% and the mouse pauses for 1/2/3 secs (like most native tasks, too), after that you can move the mouse for some seconds, then again it pauses, etc, until the Java 1.5 app is completely loaded or running for several secs. The system doesn't hang: you can still toggle Num lock, Alt-Tab switch apps, etc, and also the Java app causing all this is running happily, but several native tasks (including the mouse) "pauses"... {Edit} "java -Xincgc" to use the incremental gc, improves the situation for JEdit and my own task somewhat, but the pause effect is still there. Just for JBuilder either it doesn't make any difference or JBuilder doesn't accept this switch.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
princec
|
 |
«
Reply #3 - Posted
2004-10-28 08:18:46 » |
|
I am beginning to suspect that something is happening in DirectDraw and the current crop of drivers. If Java grabs some kind of DD handle at an inopportune moment and then decides to do something lengthy it may prevent anyone else getting it, and hence the system feels like it's hung. I may be wrong. But it's quite serious. Cas 
|
|
|
|
trembovetski
|
 |
«
Reply #4 - Posted
2004-10-29 00:30:52 » |
|
Well, to rule out possible ddraw issues, run your app with ddraw disabled: -Dsun.java2d.noddraw=true ..
|
|
|
|
Bombadil
|
 |
«
Reply #5 - Posted
2004-10-29 05:28:28 » |
|
I tried the switch but the pauses still have been there.
The -Xincgc switch so far makes the pauses at startup and JB-compile-time mildly. If I am correct the CPU load never reaches 100% then. {Edit} When Java 1.5 (re-) allocates memory on my PC it looks like it pauses most of the other PC tasks for a moment. Accordingly, when I start my app with -Xms128M -Xmx128M (to prevent allocating as long as possible) the app runs practically smooth for a long time...
As said, with Java prior to 1.5 on the same PC there are no pauses. Also with other memory hungry native apps (OO for example) I don't see any pauses.
|
|
|
|
Mark Thornton
|
 |
«
Reply #6 - Posted
2004-10-29 07:47:05 » |
|
Well, to rule out possible ddraw issues, run your app with ddraw disabled: -Dsun.java2d.noddraw=true ..
As an aside we have just discovered that ddraw can use a lot of address space --- 256MB. Even worse the area used reduced the size of the largest free space from over 500MB to less than 250MB, which caused us grief when requesting a mapping of that size.
|
|
|
|
princec
|
 |
«
Reply #7 - Posted
2004-10-29 08:26:30 » |
|
My suspicions also fall on GDI drivers... which I am beginning to think might just be using DDraw under the hood now... ...perhaps you could try using the OpenGL pipeline and see if it gets any better? (Assuming that the GL pipeline entirely takes over the entire 2D window rendering pipeline). Turn off native decorations on the window to be sure as well. Cas 
|
|
|
|
Bombadil
|
 |
«
Reply #8 - Posted
2004-10-29 11:14:34 » |
|
...perhaps you could try using the OpenGL pipeline and see if it gets any better? I tried Dsun.java2d.opengl=true but the pauses still have been there. Regularly they're not 2 or 3 sec long but shorter, still easily noticeable. Java 1.5 is the only application on my PC which pauses the entire PC. I suspect it's the memory usage (because -Xincgc as well as large start heap help a lot) but I've absolutely no idea what's the problem.
|
|
|
|
princec
|
 |
«
Reply #9 - Posted
2004-10-29 12:43:44 » |
|
I notice Eclipse does it a *lot*, and that's all GDI based widgets. Hmm. Cas 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
rreyelts
Junior Devvie  
There is nothing Nu under the sun
|
 |
«
Reply #10 - Posted
2004-10-29 13:16:04 » |
|
As an aside we have just discovered that ddraw can use a lot of address space --- 256MB. Wow Mark, that's excellent information. Thank you. God bless, -Toby Reyelts
|
|
|
|
Bombadil
|
 |
«
Reply #11 - Posted
2004-10-29 15:49:26 » |
|
I notice Eclipse does it a *lot*, and that's all GDI based widgets. Hmm. Eclipse with Java 1.5 does cause a lot of these mentioned "pauses" on your PC ? That's interesting. So does JBuilder (as I said) any my Jogl app when loading textures... However JBuilder is Swing based. Now if we could find out what behaviour these "pausing" applications share... I start to dislike the pauses a lot. :-( Anybody else noticed this behaviour?
|
|
|
|
erikd
|
 |
«
Reply #12 - Posted
2004-10-29 16:22:50 » |
|
Does it also happen with some trivial program that doesn't use any awt, swing and such. A benchmark, for example?
|
|
|
|
princec
|
 |
«
Reply #13 - Posted
2004-10-29 17:15:04 » |
|
Yeah, now I think about it, Super Elvis seems to exhibit this behaviour too on occasion. Something the VM does is causing some system-wide interruption, and it's new in 1.5. Maybe Azeem could find out if anything's changed under the hood? I consider it to be a pretty serious problem as it affects the entire system, not just making the Java apps jerky... Cas 
|
|
|
|
trembovetski
|
 |
«
Reply #14 - Posted
2004-10-30 03:56:10 » |
|
You can also run your app with -verbose:gc and see if the pauses correspond to GCs..
|
|
|
|
Bombadil
|
 |
«
Reply #15 - Posted
2004-10-30 06:39:50 » |
|
Super Elvis seems to exhibit this behaviour too on occasion. Something the VM does is causing some system-wide interruption, and it's new in 1.5. (..) I consider it to be a pretty serious problem as it affects the entire system, not just making the Java apps jerky... Ok, so now we've got two cases describing exactly the same behaviour: the "pause" effect. So it's not my PC which is being weird or such, I guess.
|
|
|
|
princec
|
 |
«
Reply #16 - Posted
2004-10-30 09:19:26 » |
|
I see it on all machines using 1.5 and Windows XP and diverse video cards. Cas 
|
|
|
|
Bombadil
|
 |
«
Reply #17 - Posted
2004-10-30 10:21:58 » |
|
I see it on all machines using 1.5 and Windows XP and diverse video cards. Ok, good to know, so it's hardly some exotic combination of hardware component A with B and some software component C... I've just rebooted the Win2K box (which I do rarely) and currently the pause effect is very mild: the mouse doesn't pause currently, a few native apps do - when there's some Java 1.5 CPU intensive task. Strange. I'll try to find out when it goes in "always pause" mode again. Some fragementation problem? Accumulation?
|
|
|
|
princec
|
 |
«
Reply #18 - Posted
2004-10-30 11:09:33 » |
|
The ONLY thing that can slow the mouse pointer down in NT is contention for either graphics card or interrupt whilst in kernel mode. This means that something in Java is grabbing exclusive access for a lengthy period in kernel mode. Not good. Cas 
|
|
|
|
Bombadil
|
 |
«
Reply #19 - Posted
2004-10-30 11:43:03 » |
|
Not good, indeed. Even worse than gurgling sound.
|
|
|
|
swpalmer
|
 |
«
Reply #20 - Posted
2004-10-31 23:01:51 » |
|
The ONLY thing that can slow the mouse pointer down in NT is contention for either graphics card or interrupt whilst in kernel mode. This means that something in Java is grabbing exclusive access for a lengthy period in kernel mode. Not good. Cas  Historically the worst offender for that sort of thing has been graphics drivers. But i didn't think they were dearly as bad these days. Unless you have a crappy old Matrox card in there (they were quite bad as I recall).  The mouse pointer is very high priority on NT. And make sure you never choose an animated pointer or you will have even bigger problems - since the pointer animation will run at such a high priority it is impossible for a user process to match it. That said, I haven't noticed this pausing problem (yet) on my systems.
|
|
|
|
Bombadil
|
 |
«
Reply #21 - Posted
2004-11-05 12:49:21 » |
|
I still don't know what's going on but finally I can reproduce the effect now: The Win2000 PC here is a multi-user system which means I login with name and passwort. I boot the PC and login for the first time: Java 1.5 runs OK - no mouse pausing (but it still takes nearly 100% for some tasks, so multi-tasking isn't fine). However, when I log-off and re-login another time, then Java 1.5 regularly pauses the mouse on many occasions.
So... I can use Java 1.5 until I've to log-off and re-login: then just a re-boot solves the pausing mouse etc.
(Does Java 1.5 perform some hidden tasks when a user logins?)
|
|
|
|
DaveLloyd
Junior Devvie  
Making things happen fast with Java!
|
 |
«
Reply #22 - Posted
2004-12-06 19:43:32 » |
|
I'm not sure if this is related but I've reverted to running NetBeans 4.0 (betas or RC) on jdk 1.4.2 because when it was running on 1.5 iTunes would glitch in the background whenever NetBeans was busy. This is on a Win2K box with 640Mb and an Athlon 2500. I've tried various gc and mem size options to no avail :-(
|
|
|
|
Jeff
|
 |
«
Reply #23 - Posted
2004-12-06 19:53:54 » |
|
Soudns lieka serious bug that should be BR'd guys. Thanks for finding it  Are one of you gusy gonan do the BR? Would nbe better then me sicne you have direct experience.
|
|
|
|
princec
|
 |
«
Reply #24 - Posted
2004-12-07 09:21:41 » |
|
Not me, I'm too good at being ignored  Cas 
|
|
|
|
Raghar
Junior Devvie  
Ue ni taete 'ru hitomi ni kono mi wa dou utsuru
|
 |
«
Reply #25 - Posted
2004-12-07 17:28:24 » |
|
Task manager icon? And how looks a task manager graph? Red and green values. Is it purely Java, or system tasks are under load as well. How do you have setuped processor planning? CPU time for all processes, or for foreground applications. What graphic drivers, GPU card, and DirectX do you have installed. Size of windoze / linux swap file. And of course, do it happen on Linux as well? Is there possiblity to test it by some weird program? I used jEdit and only problems I noticed was occasional neccesity to doubleclick on file again, I thought I clicked too fast... From my graphic attempts, roguelike based 3D engine on modified version of JOGL, I seen 100% CPU load, and 5% CPU load exactly as expected. Ken Paul Dolan program (Traveller) is running well as well.
Try to reproduce this when you'd set java on low priority. (Only possible way how to run KPD Traveller and music on background because he doesn't do Thread.yield(), or Windoze XP have severally broken Thread sheduling.)
BTW what about antialiasing bug? Has it been corrected?
Just for refference I'm running Windoze XP pro service pack2 on Celeron D 325 underclocked to 1.89 GHz. 512 MB Kingston dual chanel memory. DirectX 9.0b, or 9.0c. OS is setuped to make an equal amount of work in foreground and background processes, with reduced disk caching. (reduced means under Windoze XP 128MB to 220 MB for data cache, I wonder how much would it take when non reduced.)
|
|
|
|
Raghar
Junior Devvie  
Ue ni taete 'ru hitomi ni kono mi wa dou utsuru
|
 |
«
Reply #26 - Posted
2004-12-08 15:14:43 » |
|
Tested, seen an one mouse drag (0.1 - 0.24s) every approx 25 sec, when the KPD Traveller was in background on low priority. It didn't look like it has something to do with the KPD's GUI updates, it appeared at 100 of 500, and IIRC a young generation GC is collecting more offten. And of course could be very unrelated to current problem, when you'd like to find something, you are often succesfull (in finding something unrelated). So recommendaton for next testing is -reduced system signal switch -Xcompile (Xcompile and Eclipse is very funny be prepared) - disable vm sharing. -try interpreted mode I boot the PC and login for the first time: Java 1.5 runs OK - no mouse pausing (but it still takes nearly 100% for some tasks, so multi-tasking isn't fine). However, when I log-off and re-login another time, then Java 1.5 regularly pauses the mouse on many occasions. If logging off terminates all running programs, you have serious problem. Weird interactions between program and OS state are hard to find.
|
|
|
|
Bombadil
|
 |
«
Reply #27 - Posted
2004-12-08 16:24:18 » |
|
If logging off terminates all running programs, you have serious problem. Weird interactions between program and OS state are hard to find.
Probably my bad English... I meant "log-out" via this Windows start menu entry called, well, don't know the English word since I use a localized version. No shut-down, just log-out and re-login with another user(name). @Jeff: I didn't file a BR. I'd prefer if some native English speaker with more Java and OS experience did do it. :-)
|
|
|
|
Jeff
|
 |
«
Reply #28 - Posted
2004-12-08 17:16:32 » |
|
Not me, I'm too good at being ignored  Cas  Well, I'm doing some behind the scenes pushing on this one but a good BR would sure help... JK
|
|
|
|
Raghar
Junior Devvie  
Ue ni taete 'ru hitomi ni kono mi wa dou utsuru
|
 |
«
Reply #29 - Posted
2004-12-09 16:23:29 » |
|
You could also try to minimize your application then do some work, then maximize them again. If this could create the same effect as user switching. I expect your programs would continue running when you loggin as different user.
|
|
|
|
|