Forums › English Language Forums › Technical › Bug Reports

Search

GC Pauses due to bad programming

7 replies [Last post]
Sun, 01/05/2014 - 22:54
Hyper-Galactic's picture
Hyper-Galactic

This has been ongoing since the apocrea event.

Fix the roaming GC pauses lasting for up to half a second on some systems by fixing up your code. Noticeable GC pauses usually mean you're not re-using short-term data structures and/or over-allocating. Windows 7 system with massive GC pauses occurring for half a second every second every couple minutes or every other minute. Same happens on a macbook pro with OS X Mavricks and another system with Ubuntu Linux. Happening on Intel/AMD/Nvidia graphics cards and on Java 6 and 7 installs. Maybe the dev environment has non-standard configs, well that doesn't matter, as the defaults set by the JVM and your own settings for production are what matters. This is a classical failure on the programmer's side. You have been losing players since november over this. I know I wouldn't spent money on a program that manages to break more each month. I don't know if SK will physically stop supporting 99% of computers at this rate other than your own development stations.

Edit: Before anyone starts blurting "it's your system" it's not. I've checked three different machines with mid to high range specs on windows/mac/linux and these roving GCs that basically pause the game for half a second every second happen on them as well. Not to mention I've heard the same results from other players, including a few who stopped playing the game fed up it's unable properly to run due to these pauses.

Mon, 01/06/2014 - 08:24
#1
Skepticraven's picture
Skepticraven
Garbage Collection?

If you're asking about garbage collection, it has always been a problem prior to apocrea. This is a java based game problem as opposed to a SK problem (although you could say they use too many resources).

I resolved this on my operating systems (Win7+Linux Mint) by adding the "-server" mode in the java parameters. More info for how to do the same here.

Perhaps they should add this to the graphics options? I've read some really old tweaking threads and they java uses some of the options by default now.

If your question wasn't about garbage collection, please identify the GC acronym you're using.

Mon, 01/06/2014 - 11:09
#2
Hyper-Galactic's picture
Hyper-Galactic
GC = Garbage Collection

- This is a java based game problem as opposed to a SK problem (although you could say they use too many resources).

This pause pattern at hand is specific to spiral knights, don't blame this one on java. There's poor memory management directly in SK causing this. A proper programming style will re-use constructs and not create large objects on the fly and forget about them instantly, this is how you avoid GC pressure.

- I resolved this on my operating systems (Win7+Linux Mint) by adding the "-server" mode in the java parameters. More info for how to do the same here.

FYI, most non-[scrap] systems (you have 4 GB of ram and something better than a celeron potato?) already use -server nowadays, I know mine go into server mode. Adjusting memory limits manually also delays these pauses, but these should be specified by OOO then, not in a user-configured file hidden in the sk dir to be overwritten by steam re-verifying SK.

The fact is if you thrash the JIT's heap, expect ANY runtime garbage collection to pause your butt off with GC hangs. This is a fact on the architecture of the language's runtime, not an opinion.

Mon, 01/06/2014 - 11:35
#3
Skepticraven's picture
Skepticraven
For reference...

My 2 systems are:
Win7 : 64bit AMD (2 core@2.8GHz), 4G RAM [game runs on 1Gig]
Linux Mint: 32bit Intel (2 core#1.83GHz), 1G RAM

Both run laglessly in normal play on minimum settings without the GC lag (but there is spawning lag). The linux one has really long loadscreens just due to the slow processor.

Mon, 01/06/2014 - 11:37
#4
Hyper-Galactic's picture
Hyper-Galactic
did you adjust the ram and/or

did you adjust the ram and/or use fullscreen, doing either delays the pauses? If I use windowed mode it happens more frequently.

Mon, 01/06/2014 - 11:52
#5
Skepticraven's picture
Skepticraven
Ram usage on the linux one is

Ram usage on the linux one is capped at 512M for SK, running in windowed at 1024x600 @60Hz.

Edit: I also agree that these should probably be options from OOO directly (rather than "modding" the java options used during startup).

Mon, 01/06/2014 - 11:53
#6
Hyper-Galactic's picture
Hyper-Galactic
 

capped by default at 512 mb, although SK tries to use over 1 GB at times. Probably triggering an algo in the GC to scavenge for more RAM and has to pause SK as it's leaking references. OOO also needs to fix that, as RAM usage has shot up since apocrea.

Tue, 01/07/2014 - 09:48
#7
Momofuku's picture
Momofuku
I monitored my SK with

I monitored my SK with jconsole recently -- RAM usage seems normal (roughly 200mb min and only on occasion reached the 500mb ceiling) and the game spends most of its time performing minor GCs while performing major GCs when a new map loads.

As long as my connection is solid (and as long as the server's connection is solid, which it isn't always -- highly noticeable during beginning days of Grinchlin and Apocrea events) I experience mostly lagless play in PVE.

Can you comment which GC algos JVM has selected for you? You might need to override this yourself if you're experiencing poor performance.

Powered by Drupal, an open source content management system