Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Java 1.5 pauses my PC for some seconds regularly  (Read 8979 times)
0 Members and 1 Guest are viewing this topic.
Offline Bombadil

Senior Devvie





« 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?
Offline 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?
Offline Bombadil

Senior Devvie





« Reply #2 - Posted 2004-10-28 06:41:26 »

Quote
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!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« 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 Smiley

Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« 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 ..
Offline Bombadil

Senior Devvie





« 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.
Offline Mark Thornton

Senior Devvie





« Reply #6 - Posted 2004-10-29 07:47:05 »

Quote
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.
Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« 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 Smiley

Offline Bombadil

Senior Devvie





« Reply #8 - Posted 2004-10-29 11:14:34 »

Quote
...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.
Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« 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 Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline rreyelts

Junior Devvie




There is nothing Nu under the sun


« Reply #10 - Posted 2004-10-29 13:16:04 »

Quote
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

About me: http://jroller.com/page/rreyelts
Jace - Easier JNI: http://jace.reyelts.com/jace
Retroweaver - Compile on JDK1.5, and deploy on 1.4: http://retroweaver.sf.net.
Offline Bombadil

Senior Devvie





« Reply #11 - Posted 2004-10-29 15:49:26 »

Quote
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?
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« 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?

Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« 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 Smiley

Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« 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..
Offline Bombadil

Senior Devvie





« Reply #15 - Posted 2004-10-30 06:39:50 »

Quote
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.
Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« 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 Smiley

Offline Bombadil

Senior Devvie





« Reply #17 - Posted 2004-10-30 10:21:58 »

Quote
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?
Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« 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 Smiley

Offline Bombadil

Senior Devvie





« Reply #19 - Posted 2004-10-30 11:43:03 »

Not good, indeed.
Even worse than gurgling sound.
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #20 - Posted 2004-10-31 23:01:51 »

Quote
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 Smiley


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). Smiley

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.

Offline Bombadil

Senior Devvie





« 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?)
Offline 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 :-(

Offline Jeff

JGO Coder




Got any cats?


« Reply #23 - Posted 2004-12-06 19:53:54 »

Soudns lieka  serious bug that should be BR'd guys.
Thanks for finding it  Smiley

Are one of you gusy gonan do the BR? Would nbe better then me sicne you have direct experience.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline princec

« JGO Spiffy Duke »


Medals: 434
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #24 - Posted 2004-12-07 09:21:41 »

Not me, I'm too good at being ignored Smiley

Cas Smiley

Offline 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.)
Offline 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
Quote
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.
Offline Bombadil

Senior Devvie





« Reply #27 - Posted 2004-12-08 16:24:18 »

Quote

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. :-)
Offline Jeff

JGO Coder




Got any cats?


« Reply #28 - Posted 2004-12-08 17:16:32 »

Quote
Not me, I'm too good at being ignored Smiley

Cas Smiley



Well, I'm doing some behind the scenes pushing on this one but a good BR would sure help...

JK

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline 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.
Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (42 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (51 views)
2014-12-03 16:27:13

CopyableCougar4 (49 views)
2014-11-29 21:32:03

toopeicgaming1999 (115 views)
2014-11-26 15:22:04

toopeicgaming1999 (105 views)
2014-11-26 15:20:36

toopeicgaming1999 (31 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!