SK Performance Tweaking Guide

SK Performance Tweaking Guide
A comprehensive guide on ricing up your Java client to increase framerate, reduce stutters, and improve gameplay
This is a guide I wrote for my guild that I have decided to make public for the benefit of the SK community. I do not pretend to be an expert in Java, and these suggestions are merely what I have found works through my own research and experimentation. Many of the ideas were borrowed from previous threads on the subject, and this is my attempt to distill the most useful tweaks into one comprehensive step-by-step guide.
DISCLAIMER: I cannot guarantee that you will not encounter problems after doing the tweaks. Most people from my guild that have followed my instructions have had no issues, but I'm not making any assurances that everything will work for you. I also do not plan on offering any case-by-case technical support as I'm a busy guy and I've already laid everything out as foolproof as possible. Therefore, I advise you to only perform these tweaks if you are comfortable with them, and know how to restore any changes in case they don't work out for you.
If you like my work here, I'd appreciate if you'd check out this thread and lend your support if you like my ideas.

MAC USERS
1. Using 64-bit Java
This step will yield the most significant improvements and should be done for anyone running a 64-bit version of Mac OS. If you are a web client user, make sure you are running a 64-bit browser.
Exit SK and/or Steam
In your Java Preferences, make sure the 64-bit version(s) of Java are at the top
Navigate to your SK folder:
Web Client Users: ~/Library/Application Support/spiral/
Steam Users: ~/Library/Application Support/Steam/SteamApps/common/spiral knights
Create a file in your SK folder named "extra.txt"
Enter the line "-d64" (no quotations) and save the file
2. Checking whether SK is running in 64-bit or 32-bit mode
Open your Activity Monitor. Under the "Kind" column for the process "Spiral Knights" it should display Intel (64-bit). If it displays just "Intel" you are in 32-bit mode. You dun goofed. Recheck your work.
Web client users will have a process called "Java Applet - www.spiralknights.com"; this is not the game process.
3. Allocating additional RAM for Java
SK by default allows itself to use up to 512mb of your system memory. Even the most modest machines will have much more RAM available to utilize.
In your extra.txt file enter the following lines:
-Xms##
-Xmx##
We will configure this option based on the amount of RAM you have installed:
If you have 4GB of RAM or more, set the numbers to 3G
If you have 2GB of RAM installed, set the first value to 1G and the second value to 1536M
If you have less than 2GB of RAM, ignore this step and buy a new computer
The values given here attempt to maximize the amount of RAM allocation, even if the game does not necessarily need so much. We are erring on the side of caution and assuming you play with all extraneous applications closed.
4. Getting rid of stutters
If you have a multicore processor, enter the following lines in your extra.txt file:
-XX:+UseParallelGC
-XX:+UseParallelOldGC
If you don't have a multicore processor then enter these lines instead:
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+ExplicitGCInvokesConcurrent
5. Save your extra.txt file and enjoy smoother gameplay
Steam Users: Upon launching the game from Steam, you'll have to click "Sign in through Facebook". This will not make you sign in through Facebook, but rather bring you to this website where you can log into your Steam account just like you would for the forums. The game then launches with your proper account after you've signed in.

We need to go over some things here.
First up, in some cases Spiral Knights will not launch under Steam if 64-bit java is specified. This can be true for both Windows and OS X computers and appears to be a hiccup with Steam. In general the observed difference between 32 and 64 bit Java is so small that it's probably not worth your while.
The memory tuning is for the Java heap. As a rule of thumb, the capped physical memory SK tends to use is the Xmx + (Xmx * .5). If you set the value to "Xmx1G" SK will end up using 1.5GB of physical memory before any aggressive garbage collecting occurs. If you do not have enough physical memory available SK may unceremoniously crash without any warning. Users with 2GB if RAM and a browser open on top of SK can reach this point without much effort (especially with integrated graphics). Giving SK a 3GB allotment is just silly, there's nothing useful that comes of it. That's modded Skyrim territory.
The vast majority of users do not need to worry about changing their memory usage settings. Users running on high detail for repeated boss runs on a single session may start feeling a bit tight, but unless you're engaging in multi-hour sessions at greater than effective 1080p resolutions you really don't need to bother.
Using extra garbage collection tuning options has sometimes backfired on users, bringing in additional stutters. They really can't be used as general catch-alls. If you have a look at your launcher.log file you'll notice there's already some tuning applied. If using 64-bit Java on a recent computer you're likely triggering Java's automatic use of the -server flag anyway, which should result in parallel garbage collect being assumed.

Switching from 32-bit to 64-bit Java was a very noticeable difference for me and most people from my guild who have done the tweaks. But I welcome any case studies you have compiled to justify your statement of "in general".
Also I have had my memory usage reach 2GB. Memory usage has increased since the update that brought changes to textures. Allotting 3G is gratuitous on purpose as stated to err on the side of caution. People who have large amounts of RAM are going to be only using a fraction of it to run their background processes so there is not harm in allotting an intentionally excessive amount "just in case".
My own reason for experimenting with tweaks was to improve my performance in lockdown and nothing else. If you are primarily a clockworks player, the tweaks may not be worth your trouble. However, those who play the game primarily for PvP may empathize with the desire to mitigate any hardware based disadvantages one may have.

I don't have any home made case studies for you, I only have access to two different computers anyway. If you wish to see where much of this comes from you can always go back to the original thread on this topic. After all the suggestions you'll see that we fall back on the default settings. Remember that when that thread was initially created the game's heap size was set to 256MB by default and the "blast processing" game update had not occurred yet. In personal use, swapping out for 32/64-bit Java results in no observable change without staring at a utility like FRAPS.
My other angle is that as you read that thread you'll see people editing with these settings and creating a less playable game. You will also state that players modifying their game in this manner won't be offered official support (even though the remedy is usually just removing the added file).
Of course you will reach 2GB of usage if you set the Xmx higher. There tends to be very little garbage collection occurring until the Xmx limit is near and it will only take a run the Clockworks or a handful of Lockdown matches to get there. Either way, increasing memory allocation beyond Xmx1G isn't notable on high or low end computers. This I've tried this more than a few times.
What do you mean with the texture change increasing memory usage? I'm not seeing how tweaking alpha maps or changing settings for the Low option would result in greater memory usage.

Yup, trying to switch to 64 bit java my SK won't launch. Instead it creates an error file that contains the following:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000077580895, pid=4220, tid=7012
#
# JRE version: 7.0_03-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (22.1-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [ntdll.dll+0x50895]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x00000000037cb000): JavaThread "main" [_thread_in_Java, id=7012, stack(0x0000000003c50000,0x0000000003d50000)]
siginfo: ExceptionCode=0xc0000005, reading address 0xffffffffffffffff
Registers:
RAX=0x0000000003d4d218, RBX=0x0000000000000002, RCX=0x0000000003d4d2e8, RDX=0x0000000003d4d258
RSP=0x0000000003d4d208, RBP=0x000007feea592a50, RSI=0x0000000000000020, RDI=0x0000000000000000
R8 =0x0000000003d3e000, R9 =0x0000000000000003, R10=0x0000000000000000, R11=0x0000000000018b5c
R12=0x0000000000000000, R13=0x0000000000000050, R14=0x0000000000000003, R15=0x00000000037cb000
RIP=0x0000000077580895, EFLAGS=0x0000000000010202
Top of Stack: (sp=0x0000000003d4d208)
0x0000000003d4d208: 0000000000000202 000000007753b239
0x0000000003d4d218: 000007fffffdc000 0000000003d4d401
0x0000000003d4d228: 0000000000000000 0000000003d4d410
0x0000000003d4d238: 0000000003d4d288 000000000000000b
0x0000000003d4d248: 0000000008f30d80 0000000000000001
0x0000000003d4d258: 0000000003d50000 0000000003d3e000
0x0000000003d4d268: 0000000003d8743a 0000000003d873d0
0x0000000003d4d278: 0000000000000000 0000000000000000
0x0000000003d4d288: 0000000003d4da70 0000000003d4db20
0x0000000003d4d298: 0000000003d561b4 0000000003d55350
0x0000000003d4d2a8: 0000000000000000 000000005f1d14b6
0x0000000003d4d2b8: 0000000003d4db20 0000000003d4daa0
0x0000000003d4d2c8: 00007d2508252a74 0000000003dc6c10
0x0000000003d4d2d8: 000000000396d1a0 000000005f1d1aab
0x0000000003d4d2e8: 0000000003d4d448 00000000dae3c067
0x0000000003d4d2f8: 00000000000000b6 00000000089c9fa8
Instructions: (pc=0x0000000077580895)
0x0000000077580875: d0 00 00 00 4c 89 a1 d8 00 00 00 4c 89 a9 e0 00
0x0000000077580885: 00 00 4c 89 b1 e8 00 00 00 4c 89 b9 f0 00 00 00
0x0000000077580895: 0f ae 81 00 01 00 00 0f 29 81 a0 01 00 00 0f 29
0x00000000775808a5: 89 b0 01 00 00 0f 29 91 c0 01 00 00 0f 29 99 d0
Register to memory mapping:
RAX=0x0000000003d4d218 is pointing into the stack for thread: 0x00000000037cb000
RBX=0x0000000000000002 is an unknown value
RCX=0x0000000003d4d2e8 is pointing into the stack for thread: 0x00000000037cb000
RDX=0x0000000003d4d258 is pointing into the stack for thread: 0x00000000037cb000
RSP=0x0000000003d4d208 is pointing into the stack for thread: 0x00000000037cb000
RBP=0x000007feea592a50 is an unknown value
RSI=0x0000000000000020 is an unknown value
RDI=0x0000000000000000 is an unknown value
R8 =0x0000000003d3e000 is pointing into the stack for thread: 0x00000000037cb000
R9 =0x0000000000000003 is an unknown value
R10=0x0000000000000000 is an unknown value
R11=0x0000000000018b5c is an unknown value
R12=0x0000000000000000 is an unknown value
R13=0x0000000000000050 is an unknown value
R14=0x0000000000000003 is an unknown value
R15=0x00000000037cb000 is a thread
Stack: [0x0000000003c50000,0x0000000003d50000], sp=0x0000000003d4d208, free space=1012k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [ntdll.dll+0x50895] RtlCaptureContext+0x85
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
v blob 0x0000000003d874ff
j java.util.Properties$LineReader.readLine()I+402
j java.util.Properties.load0(Ljava/util/Properties$LineReader;)V+7
j java.util.Properties.load(Ljava/io/InputStream;)V+10
j com.samskivert.util.l.a(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/util/Properties;)Ljava/util/Properties;+47
j com.samskivert.util.l.(Ljava/lang/String;)V+20
j com.threerings.editor.p.()V+16
v ~StubRoutines::call_stub
j com.threerings.config.Parameter.()V+0
v ~StubRoutines::call_stub
j java.lang.Class.forName0(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;+0
j java.lang.Class.forName(Ljava/lang/String;)Ljava/lang/Class;+5
j com.threerings.export.b$b.(Lcom/threerings/export/b;Ljava/lang/String;B)V+141
j com.threerings.export.b.d(Ljava/lang/String;B)Lcom/threerings/export/b$b;+28
j com.threerings.export.b$b.(Lcom/threerings/export/b;Ljava/lang/String;B)V+81
j com.threerings.export.b.d(Ljava/lang/String;B)Lcom/threerings/export/b$b;+28
j com.threerings.export.b.lO()Lcom/threerings/export/b$b;+46
j com.threerings.export.b$a.lP()Ljava/util/HashMap;+87
j com.threerings.export.b.a(Lcom/threerings/export/b$b;I)Ljava/lang/Object;+462
j com.threerings.export.b.a(Lcom/threerings/export/b$b;)Ljava/lang/Object;+49
j com.threerings.export.b.a(Lcom/threerings/export/b$b;I)Ljava/lang/Object;+331
j com.threerings.export.b.a(Lcom/threerings/export/b$b;)Ljava/lang/Object;+49
j com.threerings.export.b.readObject()Ljava/lang/Object;+189
j com.threerings.config.ConfigGroup.i(Z)Z+37
j com.threerings.config.ConfigGroup.init(Lcom/threerings/config/ConfigManager;)V+25
j com.threerings.config.ConfigManager.init()V+291
j com.threerings.projectx.client.ProjectXApp.(Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V+68
j com.threerings.projectx.client.ProjectXApp.main([Ljava/lang/String;)V+189
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x0000000008fe1000 JavaThread "SoundManager.Loader" daemon [_thread_blocked, id=3304, stack(0x000000000d350000,0x000000000d450000)]
0x000000000795a800 JavaThread "Service Thread" daemon [_thread_blocked, id=5308, stack(0x0000000008520000,0x0000000008620000)]
0x0000000007959800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=4248, stack(0x0000000007c40000,0x0000000007d40000)]
0x0000000007954800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=6216, stack(0x0000000008400000,0x0000000008500000)]
0x0000000007953800 JavaThread "Attach Listener" daemon [_thread_blocked, id=6828, stack(0x00000000082c0000,0x00000000083c0000)]
0x0000000007944800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5268, stack(0x0000000007e80000,0x0000000007f80000)]
0x0000000007847000 JavaThread "Finalizer" daemon [_thread_blocked, id=6980, stack(0x0000000008130000,0x0000000008230000)]
0x000000000783e000 JavaThread "Reference Handler" daemon [_thread_blocked, id=1208, stack(0x0000000007f80000,0x0000000008080000)]
=>0x00000000037cb000 JavaThread "main" [_thread_in_Java, id=7012, stack(0x0000000003c50000,0x0000000003d50000)]
Other Threads:
0x000000000782d800 VMThread [stack: 0x0000000007d60000,0x0000000007e60000] [id=4436]
0x0000000007976000 WatcherThread [stack: 0x00000000087d0000,0x00000000088d0000] [id=5584]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
PSYoungGen total 38080K, used 14475K [0x00000000f5560000, 0x00000000f7fe0000, 0x0000000100000000)
eden space 32640K, 44% used [0x00000000f5560000,0x00000000f6382fb0,0x00000000f7540000)
from space 5440K, 0% used [0x00000000f7a90000,0x00000000f7a90000,0x00000000f7fe0000)
to space 5440K, 0% used [0x00000000f7540000,0x00000000f7540000,0x00000000f7a90000)
PSOldGen total 87168K, used 0K [0x00000000e0000000, 0x00000000e5520000, 0x00000000f5560000)
object space 87168K, 0% used [0x00000000e0000000,0x00000000e0000000,0x00000000e5520000)
PSPermGen total 21248K, used 9045K [0x00000000dae00000, 0x00000000dc2c0000, 0x00000000e0000000)
object space 21248K, 42% used [0x00000000dae00000,0x00000000db6d55c8,0x00000000dc2c0000)
Code Cache [0x0000000003d50000, 0x0000000003fc0000, 0x0000000006d50000)
total_blobs=335 nmethods=39 adapters=248 free_code_cache=48648Kb largest_free_block=49798144
Dynamic libraries:
0x000000013fc50000 - 0x000000013fc83000 c:\program files (x86)\steam\steamapps\common\spiral knights\java_vm\bin\java.exe
0x0000000077530000 - 0x00000000776d9000 C:\Windows\SYSTEM32\ntdll.dll
0x0000000077200000 - 0x000000007731f000 C:\Windows\system32\kernel32.dll
0x000007fefdae0000 - 0x000007fefdb4c000 C:\Windows\system32\KERNELBASE.dll
0x00000000706f0000 - 0x000000007073a000 C:\Program Files\AVAST Software\Avast\snxhk64.dll
0x000007feff210000 - 0x000007feff2eb000 C:\Windows\system32\ADVAPI32.dll
0x000007feff2f0000 - 0x000007feff38f000 C:\Windows\system32\msvcrt.dll
0x000007feff7a0000 - 0x000007feff7bf000 C:\Windows\SYSTEM32\sechost.dll
0x000007fefdf50000 - 0x000007fefe07d000 C:\Windows\system32\RPCRT4.dll
0x0000000077100000 - 0x00000000771fa000 C:\Windows\system32\USER32.dll
0x000007feff730000 - 0x000007feff797000 C:\Windows\system32\GDI32.dll
0x000007fefdf40000 - 0x000007fefdf4e000 C:\Windows\system32\LPK.dll
0x000007feff410000 - 0x000007feff4d9000 C:\Windows\system32\USP10.dll
0x000007fefc410000 - 0x000007fefc604000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll
0x000007feff390000 - 0x000007feff401000 C:\Windows\system32\SHLWAPI.dll
0x000007fefd820000 - 0x000007fefd877000 C:\Windows\system32\apphelp.dll
0x000007feed240000 - 0x000007feed29a000 C:\Windows\AppPatch\AppPatch64\AcLayers.DLL
0x000007fefa8c0000 - 0x000007fefa931000 C:\Windows\system32\WINSPOOL.DRV
0x000007fef9db0000 - 0x000007fef9dc8000 C:\Windows\system32\MPR.dll
0x000007feea4b0000 - 0x000007feea917000 C:\Windows\AppPatch\AppPatch64\AcXtrnal.DLL
0x000007feed330000 - 0x000007feed381000 C:\Windows\AppPatch\AppPatch64\AcGenral.DLL
0x000007fefd7f0000 - 0x000007fefd815000 C:\Windows\system32\SspiCli.dll
0x000007fefe080000 - 0x000007fefe283000 C:\Windows\system32\ole32.dll
0x000007fefe2e0000 - 0x000007feff068000 C:\Windows\system32\SHELL32.dll
0x0000000071100000 - 0x0000000071103000 C:\Windows\system32\sfc.dll
0x000007fef9210000 - 0x000007fef9220000 C:\Windows\system32\sfc_os.DLL
0x000007fefcce0000 - 0x000007fefccfe000 C:\Windows\system32\USERENV.dll
0x000007fefd990000 - 0x000007fefd99f000 C:\Windows\system32\profapi.dll
0x000007fefb990000 - 0x000007fefb9a8000 C:\Windows\system32\dwmapi.dll
0x000007feff620000 - 0x000007feff64e000 C:\Windows\system32\IMM32.DLL
0x000007feff510000 - 0x000007feff619000 C:\Windows\system32\MSCTF.dll
0x0000000180000000 - 0x0000000180007000 C:\Program Files\Prio\prio.dll
0x000007feed040000 - 0x000007feed0ed000 C:\Program Files (x86)\Steam\GameOverlayRenderer64.dll
0x000000006fbf0000 - 0x000000006fcc1000 c:\program files (x86)\steam\steamapps\common\spiral knights\java_vm\bin\msvcr100.dll
0x000000005f010000 - 0x000000005f6ea000 c:\program files (x86)\steam\steamapps\common\spiral knights\java_vm\bin\server\jvm.dll
0x000007fef6660000 - 0x000007fef6669000 C:\Windows\system32\WSOCK32.dll
0x000007fefe290000 - 0x000007fefe2dd000 C:\Windows\system32\WS2_32.dll
0x000007feff4e0000 - 0x000007feff4e8000 C:\Windows\system32\NSI.dll
0x000007fefacb0000 - 0x000007fefaceb000 C:\Windows\system32\WINMM.dll
0x00000000776f0000 - 0x00000000776f7000 C:\Windows\system32\PSAPI.DLL
0x00000000749d0000 - 0x00000000749df000 c:\program files (x86)\steam\steamapps\common\spiral knights\java_vm\bin\verify.dll
0x00000000734d0000 - 0x00000000734f8000 c:\program files (x86)\steam\steamapps\common\spiral knights\java_vm\bin\java.dll
0x0000000073bc0000 - 0x0000000073bd5000 c:\program files (x86)\steam\steamapps\common\spiral knights\java_vm\bin\zip.dll
0x0000000073ba0000 - 0x0000000073bb9000 C:\Program Files (x86)\Steam\steamapps\common\spiral knights\java_vm\bin\net.dll
0x000007fefd1c0000 - 0x000007fefd215000 C:\Windows\system32\mswsock.dll
0x000007fefd1b0000 - 0x000007fefd1b7000 C:\Windows\System32\wship6.dll
0x00000000739c0000 - 0x00000000739d1000 C:\Program Files (x86)\Steam\steamapps\common\spiral knights\java_vm\bin\nio.dll
0x000000006e7e0000 - 0x000000006e974000 C:\Program Files (x86)\Steam\steamapps\common\spiral knights\java_vm\bin\awt.dll
0x000007feff650000 - 0x000007feff727000 C:\Windows\system32\OLEAUT32.dll
0x0000000000a30000 - 0x0000000000a7f000 C:\Program Files (x86)\Steam\steamapps\common\spiral knights\native\lwjgl64.dll
0x000007fef1c30000 - 0x000007fef1d4d000 C:\Windows\system32\OPENGL32.dll
0x000007fef1c00000 - 0x000007fef1c2d000 C:\Windows\system32\GLU32.dll
0x000007fef1b00000 - 0x000007fef1bf1000 C:\Windows\system32\DDRAW.dll
0x000007fef1af0000 - 0x000007fef1af8000 C:\Windows\system32\DCIMAN32.dll
0x000007fefdd60000 - 0x000007fefdf37000 C:\Windows\system32\SETUPAPI.dll
0x000007fefdb70000 - 0x000007fefdba6000 C:\Windows\system32\CFGMGR32.dll
0x000007fefdb50000 - 0x000007fefdb6a000 C:\Windows\system32\DEVOBJ.dll
0x000007fefcad0000 - 0x000007fefcadc000 C:\Windows\system32\VERSION.dll
0x000007feecf10000 - 0x000007feed032000 c:\program files (x86)\steam\steamapps\common\spiral knights\native\OpenAL64.dll
0x000007fef1d50000 - 0x000007fef1dd8000 C:\Windows\system32\dsound.dll
0x000007fefc300000 - 0x000007fefc32c000 C:\Windows\system32\POWRPROF.dll
0x000007fefd880000 - 0x000007fefd88f000 C:\Windows\system32\CRYPTBASE.dll
0x000007feff170000 - 0x000007feff209000 C:\Windows\system32\CLBCatQ.DLL
0x000007fefc2b0000 - 0x000007fefc2fb000 C:\Windows\System32\MMDevApi.dll
0x000007fefc180000 - 0x000007fefc2ac000 C:\Windows\System32\PROPSYS.dll
0x000007fef1920000 - 0x000007fef195b000 C:\Windows\system32\wdmaud.drv
0x0000000074bf0000 - 0x0000000074bf6000 C:\Windows\system32\ksuser.dll
0x000007fefc610000 - 0x000007fefc619000 C:\Windows\system32\AVRT.dll
0x000007fefbe50000 - 0x000007fefbe9f000 C:\Windows\system32\AUDIOSES.DLL
0x000007fef0e90000 - 0x000007fef0e9a000 C:\Windows\system32\msacm32.drv
0x000007fef0e70000 - 0x000007fef0e88000 C:\Windows\system32\MSACM32.dll
0x000007fef0e00000 - 0x000007fef0e09000 C:\Windows\system32\midimap.dll
0x000007fefc0c0000 - 0x000007fefc116000 C:\Windows\system32\uxtheme.dll
0x000000000b690000 - 0x000000000b755000 C:\Program Files (x86)\Stardock\ObjectDockFree\Dock64.dll
0x0000000010000000 - 0x0000000010021000 C:\Windows\system32\OpenAL32.dll
0x000000000c8b0000 - 0x000000000cd33000 C:\Windows\system32\wrap_oal.dll
VM Arguments:
jvm_args: -Dcom.threerings.getdown=true -Xmx256M -XX:+AggressiveOpts -XX:SoftRefLRUPolicyMSPerMB=10 -Djava.library.path=c:\program files (x86)\steam\steamapps\common\spiral knights\./native -Dorg.lwjgl.util.NoChecks=true -Dsun.java2d.d3d=false -Dappdir=c:\program files (x86)\steam\steamapps\common\spiral knights\. -Dresource_dir=c:\program files (x86)\steam\steamapps\common\spiral knights\./rsrc -Xmx512M
java_command: com.threerings.projectx.client.ProjectXApp
Launcher Type: SUN_STANDARD
Environment Variables:
CLASSPATH=.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
PATH=C:\Program Files (x86)\Steam;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\DMIX;C:\Program Files\Prio;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Common Files\Microsoft Shared\Windows Live
USERNAME=Ricardo
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows Vista , 64 bit Build 6000
CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 42 stepping 7, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt
Memory: 4k page, physical 8363148k(5381756k free), swap 16724444k(12728460k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (22.1-b02) for windows-amd64 JRE (1.7.0_03-b05), built on Feb 3 2012 20:43:56 by "java_re" with unknown MS VC++:1600
time: Sat Aug 18 06:35:48 2012
elapsed time: 0 seconds

Don't know why it says i'm on windows vista btw, i'm using windows 7 ultimate.

That's because Windows Vista and Windows 7 are both Windows 6 at their core, so that's probably the reason why. I'm not entirely sure. Think of it this way: Windows 7 is just Vista with a spruced up GUI and some optimizations. Other than that, they're the exact same thing.

At my laptop, windows 7 pro 64bit after switching from java 32 to java 64 (newset java 7) i have encountered a lot of laptop crashes caused by spiral knights/java after switching to java 32 those crashes occur incidentialy. Those crashes mostly happen when im on elevator and im about to click down/descend button. Did anyone noticed those things too?

people may not need tweaking at all. So no tweaks could be better than tweaking in some cases.
One problem with the tweaks you mentioned are that most of them are left over from the pre-Steam SK days. After Steam version release, OOO had done some optimization to their code to make things run smoother (at least on Steam). Another problem is that there aren't a lot of benchmarking going on with the tweaks. So people often "feel" there is a difference (e.g. my lag stopped or reduced on some maps), but it could just be placebo effect, or the problem has been mitigated to another part of the game (e.g. lags move to another map, or just takes longer to show up).

In my experience using 64bit java, I did not have a noticeable increase in performance and the music stuttered.

@Dogrock
http://forums.spiralknights.com/en/node/55978
Following the above patch on June 6, many people experienced crashes after running the game for ~10 minutes. I had observed that memory usage would gradually increase until no more memory was available and the game crashed. Since I had allotted 6x the default memory, I was able to play for much longer before my client would eventually crash also, during which memory usage would max out at the 3G I have set for my max heap.
A later patch would fix this bug, but I have noticed that peak memory usage since then has always been higher than it was previously.
@Meida
I know I said I wouldn't be offering tech support but since you're my broheim, I'll offer you some suggestions. Mind you I don't know how to decrypt the error report so I'm just going off of trial and error that worked for other people I've helped with this.
First make sure that you did not simply copy the contents of the jre folder into the java_vm folder. Rename the java_vm folder into a backup and make a fresh java_vm folder.
From your error report, it looks like you replaced the java_vm steam folder with jre7 (Java 7). I know when I was helping Entro with this, we managed to used jre7 fine. However just in case, you should try copying the jre6 folder instead and see if that helps.
Lastly you can try setting the heap size modifiers to -xms1g and -xmx2g. If for some reason you were actually running 32-bit Java, this will allow it to run and you can check if that's the case in your process manager. If you are indeed running 32-bit, make sure you are copying the jre folder from C:\Program Files\Java and NOT C:\Program Files (x86)\Java. Apologies in advance if you were diligent with it to begin with, but it's a minor error that people often overlook.
@Eltia
Definitely not a placebo effect. An obvious thing that I noticed was that with 64-bit Java, opening the PvP tab or Auction House resulted in a smooth expanding animation that I had not been able to observe previously with 32-bit Java due to a lengthily stutter that would occur during the animation instead.

Again, until we see benchmark to support this claim, I still think a lot of these tweaks are nothing more than placebos. I for one, see no significant performance gain from using Java x64 (and I tried both Java 6 and 7). The memory usage went up though thanks to larger pointer size.
Let's not forget the mitigation problem. If you gain performance in first 3 levels in FSC and then it starts to lag badly in the last 2 levels, that isn't much of a tweak worth pursuing.

Thanks Thrill, I notice the difference in LD, especially in Lagbite. In the beginning it stutters for a couple seconds (which doesn't bother me) but it gets instantly smooth after that.
props

Oh yeah I forgot thank you for this, so smooth, I can't believe it's not butter. Thanks homie.

I should chime in on this too,
In between a 7 month break I went back to SK about 2 months ago, and during that hiatus I went from a 32bit system to a 64bit one. Aside from various problems i ran into at first, I finally got it working, but it was as clunky as I remember. Then I revisited this thread and evaluated where I stood regarding the suggestions given here. To my surprise the extra.txt file was still in my SK file folder in the Steam directory with all my old tweaks in it, and the only thing I hadn't tried was upgrading the SK java to 64bit, which I then cautiously implemented.
So the verdict: The difference between 32bit and 64bit java are night and day to me.
In fact, the game is nearly unplayable when in Task Manager, if java.exe is set to Priority>Real Time, as event detection such as giving and receiving damage is instant, ie. before i even swing my sword the damage numbers show up as if I had already hit my target. What I am saying here is that the game is TOO FAST for me on this setting, and a normal priority setting in Task Manager works just fine with the above mentioned tweaks.
There's my 2 drachmas.

Damn, I wish this would work for me.
But, alas, SK won't launch under 64-bit Java.

Try using jre6 if you're using jre7. I've had people report problems with jre7. Using jre6 instead usually did the trick.

You are amazing! I love you! Why is this not detailed in install notes or wiki!? - I played over a year until Ewbte pointed me to this.
Finally my OC'd i7 @ 4ghz, 6gb ddr3, gtx670 are using more cores, mem and in 64bit, and it is so smoooooooth! YES!
final comment: ZOMG!

specs:
intel core i5 2320 @3.20 Ghz
8GB ram
sapphire radeon HD 6570 1GB ddr3
my extra.txt file looks like this
-server
-XX:+UseParallelGC
-XX:+UseParallelOldGC
-Xms512m
-Xmx6G
-XX:+CMSIncrementalPacing
-Dsun.java3d.opengl=true
-Dsun.java2d.ddscale=true
-Dsun.java2d.translaccel=true
-Dsun.java2d.ddforcevram=true
-XX:ReservedCodeCacheSize=128m
-XX:+UseFastAccessorMethods
-XX:MaxPermSize=128m
-XX:+UseLargePages
note: the -server flag only worked for me when i downloaded jre7 which you find in the download section of the java website NOT in the big red button that pops out first, this flag makes java run in server mode which uses more of your computer resources (old performance thread)
also if you want to confirm that you are running the java environment in 64 bit go to your task manager and find the process named java.exe
if you are running still in 32 bit it will appear as javaw.exe
i did a benchmarking on forest on low settings and 8x antialias which is my personal preference and this are some results using fraps
forest before extra.txt min=38 avg=55 max=80
forest after extra.txt min=60 avg=78 max= 121

Timbalero,
You should remove all those flags you've added that start with Dsun. They are irrelevant in Spiral Knights and at best do nothing for your performance. Spiral Knights only uses Java's OpenGL pipeline, so Dsun.java3d.opengl=true
is redundant. The others are irrelevant since they only apply to the Direct Draw system, which is not in use for Spiral Knights.
I'm also not sure that XX:+CMSIncrementalPacing
is doing anything since the concurrent garbage collector needs to be enabled first. You don't appear to have enabled it.

Every time I mentioned lag around anyone from aequitas they gave me performance tips. Was wondering why until now...
Actually I find it odd that the number for max ram is that low, since task manger has been reporting values in the 500MB-1GB range for months since the "blast processing" update (which caused some of my friends to lag more >:O )

As already mentioned, those java2d and java3d flags don't do anything. I tested them long time ago and found out they made no differences.
I have some skepticism about your results also as you don't seem to be using the concurrent GB. Usually a lot of these tweaks would give you the illusion of performance boost initially. But when the memory being used accumulate, the cost to keep track of and clean up these memories increase also. So it's not unusual that after you play for a while (say at least 1 hour), you start to experience micro-stuttering.
OP should link to this thread, as this is the original repository for all the tweaking which you seem to be duplicating.

i forgot to mention the benchmarking was also before and after using 64 bit java btw
i edited my extra.txt so now it looks like this
-server
-XX:+UseParallelGC
-XX:+UseParallelOldGC
-Xms512m
-Xmx6G
-XX:ReservedCodeCacheSize=128m
-XX:+UseFastAccessorMethods
-XX:MaxPermSize=128m
-XX:+UseLargePages
-Xrs
tell me if i should change anything or theres any redundancies please since i wanna use all the resources my system has to offer to run the game

If I were duplicating the contents of that thread I would not have bothered making my own thread. I did draw certain ideas from that thread as well as other resources, but there were also redundancies which have been removed in my version, which I consider to be definitive based on extensive testing done by myself and my fellow members of Aequitas.
Nowhere in that thread are there comprehensive cross-platform instructions to performing the tweaks nor a clear cut opinion on which tweaks to use. One would have to go through the same amount of experimentation I did, as well as seek out other threads or websites for instructions on how to perform them if they are running the steam client, or macOS.
I fail to see the point in all the posts you have made in this thread. Is your objective to dissuade people from trying out a free, reversible and non-time consuming tweak that could potentially improve their game performance, simply because it did not create a significant difference for you (and your system specs which everyone else apparently also shares)? Did you even try the tweaks?

Y U NO HAVE LINUX VERSIONNN!!!
I'm just gonna convert to a LDE and keep my cpu at performance.
any general tips for linux? if not I'll leave you alone :P

@Redblades:
The only OS-specific stuff is Java installation and process bitness detection. For the former, use your package manager. For the latter, use file -L ~/spiral/java/bin/java
. The rest is whichever extra.txt does it for you.

/home/(name)/.getdown/spiral
I'm now in a folder with 4 folders and some text files
folders:
code
native
rsrc
scenes
text files:
too many to type.
~~~~~~~~~~~~~~
should I put the extra.txt file here? because I've tried and SK won't even run :P

It goes in the directory that contains the spiral
script that actually runs the thing, so yes.

If your SK client doesn't run after creating the extra.txt it may be because you're using a 32-bit build of Linux and have requested more RAM usage within the extra.txt than a 32-bit system can handle.
How am I supposed to save a .txt file? Whenever I try to save a file as this it gives me an error, saying I can't do that and suggesting .rtf. I'm a Mac user and I've tried microsoft word and textedit. Please help?
Thanks thrillhaus, major fail on my part.
A second problem I have is when I do this step
Navigate to your SK folder:
Web Client Users: ~/Library/Application Support/spiral/
Steam Users: ~/Library/Application Support/Steam/SteamApps/common/spiral knights
Create a file in your SK folder named "extra.txt"
Enter the line "-d64" (no quotations) and save the file
I started Spiral Knights through Steam (after I checked that it was 64bit) and then it automatically tried to make a new character. When I went back to the login screen, there was a long and weird random string of letters numbers and symbols it the username field, and I couldn't log on using that or my regular username.
I changed back to 32bit by removing the extra.txt file from the Spiral Knights folder, but I would really like to use 64bit.
Anyone know what to do?
I tried everything that is written and it works fine when i play alone but i still get a lot of spikes on multiplayer (with 3 more players). Do you know what to do? I have the 64 bit java, 6 Gb of ram, i3 second generation processor, and 1gb video card and the latest drivers.

If you're launching in Steam on a Mac, you're required to click "Sign in through Facebook" which doesn't actually make you sign into facebook, but rather sign into this website with your steam account. The client then launches after you've signed in.
I've updated the OP with this information.

Thanks for sharing this info, it's very helpful. I'm definitely seeing improved performance on my Mac after applying these tweaks.

lol I'm sure I'm using 64
anyways, using xms and xmx 3g now since I replaced 1g ram chip with 2g :O
soo I'm fine ;D
oooh and I pointed it to some friends, friends irl, and guildies
they all happily giving me money
jk they're just happy :D
cheers~
I need some help, please! I've done everything which is written and when i play alone it works a lot much better than before, but when i play with more than 1 player, it doesn't work very well. I have low fps and a lot of spikes (about 1-2 seconds). Thanks!

After copying the JRE 6 folder and renaming it to Java_vm spiral knights doesn't launch anymore from Steam. That being said I haven't tried launching through the browser.

Using internet explorer 64 bit and playing Spiral Knights 64bit made it so that my game is completely lagless.
This is the first time I've been lagless in Spiral Knights, ever.
Thrill, all my love.

If I use my jre6 folder as java_vm, the game doesn't run. java.exe shows but then goes away in task manager after a moment or two.
Will the extra.txt tweaks still have an effect without 64 bit?

After doing this my sound has turned quite crappy compared to before. Any idea why?

@Wolframx: Sorry but every system is different. Yours should theoretically run the game great. You could try experimenting with different heap sizes (the xmx and xms variables). Make sure you are using the multicore GC lines. There is nothing else I can suggest that wouldn't require me to just look on google, which you are capable of doing.
@Bananaphonehaha: Make sure you are not allocating more RAM usage than your system can handle. If 64bit SK launches without the extra.txt but crashes with it, you're doing something wrong with the heap size variables. And yes, the biggest difference is the 64bit. You can try using the extra.txt in 32bit (don't set your heap size more than 2G if you do this) but 64bit is the important part.
@Luckyface: Stop using Beats headphones.
Guys,
Is correct my code?
I saved in ~/Library/Application Support/Steam/SteamApps/common/spiral knights as "extra.txt"
-XX:+UseParallelGC
-XX:+UseParallelOldGC
-Xms4G
-Xmx4G
-d64
My iMac (configuration)
Processor: Intel Core i5 ("Sandy Bridge")
Processor Speed: 2.5 GHz
Architecture: 64-bit
Number of Cores: 4 (Quad-Core)
Cache: 6 MB
Storage: 500 GB (7200-rpm SATA)
Peripherals: Apple Wireless Keyboard, Magic Mouse
Installed RAM: 12GB (2x2Gb + 2x4Gb)
Type of RAM Slots: [4 slots] 204pin PC3-10600 (1333 MHz) DDR3 SO-DIMM
Display: 21.5" (viewable) LED (backlit glossy) widescreen TFT LCD
Resolutions: 1920x1080 pixels (FullHD)
Graphics Card: AMD Radeon HD 6750M
Graphics Memory: 512 MB GDDR5
Operacional System: MAC OS X Lion 10.7.5
Client Steam: YES
thx
my code is :
-Xms4G
-Xmx4G
-XX:+UseParallelGC
-XX:+UseParallelOldGC
Thanks for help!
PC USERS
(Mac users scroll down. Sorry, no Linux version)
1. Using 64-bit Java
This step will yield the most significant improvements and should be done for anyone running a 64-bit version of Windows.
For Web Client Users:
If you have 64-bit Java installed, Spiral Knights should automatically launch in 64-bit mode if you are running a 64-bit browser. Some browsers such as Firefox will default to 32-bit Java unless additional plugins for 64-bit Java are installed. The easiest way to launch in 64-bit mode without installing anything is to run SK using Internet Explorer (64-bit) which should come with all 64-bit versions of Windows.
For Steam Users:
Exit both Steam and SK
Navigate to your SK folder (C:\Program Files (x86)\Steam\steamapps\common\spiral knights)
In this folder, there will be a folder named “java_vm”; rename it to “java_vm_backup”
Navigate to your Java folder (C:\Program Files\Java); make sure you are not in the (x86) folder
In this folder there will be a folder named either “jre6” or “jre7”; UPDATED: Copy the jre6 folder instead of jre7. I've received feedback of jre7 not working for some people. If you do not have jre6, download it here.
Navigate back to your SK folder and paste the jre6 folder; rename it to “java_vm”
In your SK folder create a file named “extra.txt”, we will come back to this later
2. Checking whether SK is running in 64-bit or 32-bit mode
Open your task manager and select the “processes” tab. Upon launching SK, a new instance of “java.exe” should appear. If “java.exe *32” appears instead, it means you are still running in 32-bit mode. You dun goofed. Recheck your work.
3. Creating an “extra.txt” file for additional tweaks
Java comes with various command line options that can alter the way it runs. We can set these options to run when SK starts by created an “extra.txt” file in the SK folder.
For Web Client Users:
Exit SK
Open your start menu and enter %appdata% at the bottom; hit enter
You will be brought to your ~Users\AppData\Roaming folder
Navigate back to ~Users\AppData and double-click the “LocalLow” folder, then the “spiral” folder; this is your SK folder
In your SK folder create a file named “extra.txt”
For Steam Users:
If you read Part 1, you should already have done this.
4. Allocating additional RAM for Java
SK by default allows itself to use up to 512mb of your system memory. Even the most modest machines will have much more RAM available to utilize.
In your extra.txt file enter the following lines:
-Xms##
-Xmx##
We will configure this option based on the amount of RAM you have installed:
If you have 4GB of RAM or more, set the numbers to 3G
If you have 2GB of RAM installed, set the first value to 1G and the second value to 512M
If you have less than 2GB of RAM, ignore this step and buy a new computer
The values given here attempt to maximize the amount of RAM allocation, even if the game does not necessarily need so much. We are erring on the side of caution and assuming you play with all extraneous applications closed.
5. Getting rid of stutters
If you have a multicore processor, enter the following lines in your extra.txt file:
-XX:+UseParallelGC
-XX:+UseParallelOldGC
If you don't have a multicore processor then enter these lines instead:
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+ExplicitGCInvokesConcurrent
6. Save your extra.txt file and enjoy smoother gameplay