Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
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  
  GC Bomb - CMS GC starves high priority system threads  (Read 19283 times)
0 Members and 1 Guest are viewing this topic.
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #30 - Posted 2005-08-05 02:19:31 »

HotSpot has a deliberate mapping of Java priorities to Windows thread priorities where Java's maximum priority maps to THREAD_PRIORITY_TIME_CRITICAL and its minimum priority maps to THREAD_PRIORITY_LOWEST. See src/os/win32/os_win32.cpp, java_to_os_priority, in the Mustang HotSpot sources if you're curious. It's a simple change to downgrade the maximum possible setting to THREAD_PRIORITY_HIGHEST, but is that the right thing to do for all applications? It seems to me that the application should simply not be using the maximum priority (or, in fact, adjusting thread priorities at all) unless it's absolutely necessary. -XX:-UseThreadPriorities is the "big hammer" switch added to HotSpot at one point because of problems like this.

Are most of the issues seen on this thread caused by exactly this problem (e.g., swpalmer)? As far as I understand it, this isn't the root cause behind the glitches in mouse pointer tracking that have been seen in other applications like Eclipse and NetBeans on some machines which I consider to be a more serious problem (i.e., possibly not an application-level problem).

Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #31 - Posted 2005-08-05 11:37:37 »

This is precisely the root cause of the problem. No Java threads should be able to run as a time-critical thread on Windows; it buggers the whole system up, and there's not even any security on it. It'll make a DoS attack trivial. So perhaps this issue should be escalated a bit Smiley

Cas Smiley

Offline abies

Senior Devvie





« Reply #32 - Posted 2005-08-08 07:23:07 »

No Java threads should be able to run as a time-critical thread on Windows; it buggers the whole system up, and there's not even any security on it. It'll make a DoS attack trivial.Cas Smiley

As far as I understand, you are not able to set priority higher on thread that it is on threadgroup and you cannot modify it at all without correct permissions - so it should be enough for avoiding DoS in applets.

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

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #33 - Posted 2005-08-08 09:28:00 »

I dunno about anyone else but I've always wanted to attach some actual security to "trusted" code as well to prevent it monkeying around with my system and rendering it unusable by accident... there's already two great limiters in the JVM right now which limit its Java heap space and also C heap space, but there's no limits on creating any other OS resources. It seems a little disjointed.

Cas Smiley

Offline jouni

Senior Newbie





« Reply #34 - Posted 2005-09-26 13:19:56 »

This is the bug 5101898 in Sun's bug database. See:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5101898

See also discussion in

http://forum.java.sun.com/thread.jspa?threadID=666691&tstart=0
Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #35 - Posted 2005-09-26 15:34:25 »

Hurrah! Fixed in Mustang. <edit>And, apparently, 1.5.0_06.

Cas Smiley

Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #36 - Posted 2005-09-27 02:41:37 »

I saw that this was fixed in Mustang... but where did you get the info that an _06 build was coming with the fix for Java 5?  Heck, I just got 1.5.0_05!

Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #37 - Posted 2005-09-27 09:50:53 »

Rumours on teh intarweb.

Cas Smiley

Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #38 - Posted 2005-10-04 04:49:15 »

Well, doesn't Alan Bateman mention that it's been fixed in _06 in the second posted thread?

http://forum.java.sun.com/thread.jspa?threadID=666691&tstart=0

see the last post.

Dmitri
Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #39 - Posted 2005-10-04 12:17:38 »

Until it's officially closed in Bug Parade, it's a rumour on teh intarweb Wink

Cas Smiley

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

Junior Devvie




Java VM Engineer, Sun Microsystems


« Reply #40 - Posted 2005-10-04 15:34:38 »

It is fixed in 1.5.0_06 Smiley
Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #41 - Posted 2005-10-04 23:13:36 »

I reckon that counts as a "reliable rumour" Wink

Cas Smiley

Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #42 - Posted 2008-03-18 11:23:57 »

Necro!

This bug has returned with a vengeance in JRE6... and needs to be un-regressed! There are TIME_CRITICAL threads all over the place once more.

Cas Smiley

Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #43 - Posted 2008-03-18 11:35:27 »

No wait! I tell a lie. It's different this time.. here's the symptoms:

Run Ultratron in Eclipse (java6ea) - game runs smoothly.
Run Ultratron as standalone executable, no Eclipse running in background - game runs smoothly.
Run Ultratron as standalone executable, Eclipse minimised in background - occasional, regular, 1 second pauses. Grr.

Any ideas on this particularly odd interaction? I feel that it's something similar to what it was before.

Cas Smiley

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #44 - Posted 2008-03-18 13:42:10 »

I'm not sure if it's related, but I'm noticing some strange behaviour of java6 at work:
Sometimes the whole OS (still running Win2000 here) almost freezes completely! When that happens (sometimes 5 times a day, sometimes 2 times a week), trying to kill all java processes solves the problem (that is, if the OS isn't frozen too much).
The problem seems to be triggered by running java6 and a java 1.4.2 version at the same time, as axing Lotus Notes' JRE (1.4.2) and replacing it with a java6 JRE seems to make the problem almost go away (making all applications use the same java6). Weird but true  Undecided. There's still the occasional short, system-wide pauses though...

Cas, does Ultratron still have the same problem if you run Eclipse with the same JRE version as Ultratron?

Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #45 - Posted 2008-03-18 15:36:58 »

Yes.

The plot thickens... turns out all games are afflicted with 1-second pauses when Eclipse is running. It might just be a daft Eclipse thread doing it.

Cas Smiley

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #46 - Posted 2008-03-18 16:39:41 »

But then, are things any different between 1.4 and 1.6?

Offline verkel

Innocent Bystander





« Reply #47 - Posted 2008-03-26 06:21:01 »

The plot thickens... turns out all games are afflicted with 1-second pauses when Eclipse is running. It might just be a daft Eclipse thread doing it.

Cas Smiley

This is probably due to the idle GC feature in Eclipse. When the IDE detects itself as "idle", it periodically runs System.GC() to reduce perceived memory footprint. This however causes its CPU usage to spike and pauses games and other CPU intensive apps.

It's discussed in this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=118335

You can run eclipse with: eclipse -vmargs -Dide.gc=false, as described in the post #8. This disables the idle GC and fixes the pauses, at least for me.

And oh, hi. First post, long time lurker. Smiley
Offline princec

« JGO Spiffy Duke »


Medals: 429
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #48 - Posted 2008-03-26 10:36:14 »

And what an excellent first post Smiley Most welcome.

Cas Smiley

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 (29 views)
2014-12-15 09:26:44

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

BurntPizza (40 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 (50 views)
2014-12-03 16:27:13

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

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

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

toopeicgaming1999 (30 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!