Switch to full style
Guides, tips, tricks, etc.
Post a reply

Modifying Garbage Collection to increase performance

Mon Jul 29, 2013 2:18 pm

Rs as you well know is an application written in the Java programming language.
(the latest info I have, runetek is built on Java 6, but that might be outdated)

First, a little background info to explain what I'm doing:

Java is a garbage collected language, which is supposed to make life easier for the programmer. Non-garbage collected languages (for the most part, you could argue Objective-C is an exception and other languages that use allocate by reference counting, but I digress) require the programmer to manually determine how the application handles its RAM usage.

Periodically, the JVM that Java Applications run on top of will check to see if certain parts of the program are being unused at the time, and will remove those parts from memory. The default garbage collector in Java works serially, which means that the application itself is paused while the objects are cycled out of memory. In Java, garbage collection happens at non-predictable times, it is impossible to force the program to garbage collect.

So what does this mean?

Java has provided 2 different Garbage collectors besides the default that are designed to improve application performance by working in parallel with the application, and a required pause in the application is either extremely short, or will not happen very often, if at all.

=This concludes the wall of text=


Close RS before you make these modifications, you will not be able to save otherwise.

For Browser

Adding the Parallel GC method requires you to go to Control Panel/System Preference and locate the Java panel, click on it and navigate to the Java tab

Image

Enter the following line into 'Runtime Parameters' -XX:+UseParNewGC

It should look like this:

Image


For Client

The way to modify the GC for RS is by editing the runescape.prm file in notepad or w/e text editor you use.

This file can be found in C:\Users\YourUsername\jagexcache\jagexlauncher\runescape

I believe the .prm extension is hidden by default, edit the file titled 'runescape'.

Delete the line labeled -XX:+UseConcMarkSweepGC and save

Restart Rs

Door lag should be less significant, grey screen/black screen should also occur less frequently.

If this does not help you, let me know.

This works because two garbage collection methods are assigned to Rs, which seems to be a very dumb thing and is not recommended by Oracle. According to my test subjects, -XX:+UseParNewGC provides the greatest boost in performance. If you find the opposite is true, please provide the specs of your computer for research purposes.

If you want to learn more about Garbage Collection in Java + Performance tuning, here are some fine resources from Oracle (The company that owns Java):

http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html

http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html

http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html

Re: Modifying Garbage Collection to increase performance

Sun Sep 01, 2013 8:04 am

Jagex has implemented multicore support in the client, + I discovered a few new vm options (I don't program java normally so I stumble across this stuff)

Blatantly stolen from rs wiki: http://runescape.wikia.com/wiki/Game_Cl ... re_support

For the daring, add the following to your prm/info.plist:
-XX:MaxGCPauseMillis=500
-XX:SurvivorRatio=16

These might cause problems, further research is in progress
-XX:DisableExplicitGC
-XX:+AgressiveOpts
-XX:+UseAdaptiveGCBoundary

Re: Modifying Garbage Collection to increase performance

Sun Sep 01, 2013 2:50 pm

This did not happen to me on my computers, but apparently one of the above options can cause some people's clients to not open. If you want to try it, put one vm option in at a time, and see which one does not work, hl me on skype/post here w/ results pls.

Re: Modifying Garbage Collection to increase performance

Sun Sep 01, 2013 4:08 pm

Catachresis wrote:Jagex has implemented multicore support in the client, + I discovered a few new vm options (I don't program java normally so I stumble across this stuff)

Blatantly stolen from rs wiki: http://runescape.wikia.com/wiki/Game_Cl ... re_support

For the daring, add the following to your prm/info.plist:
-XX:DisableExplicitGC
-XX:+AgressiveOpts
-XX:+UseAdaptiveGCBoundary
-XX:MaxGCPauseMillis=500
-XX:SurvivorRatio=16


For the top 3:
-XX:DisableExplicitGC
-XX:+AgressiveOpts
-XX:+UseAdaptiveGCBoundary

The client launcher won't launch for me when I add the to the .prm

It launches with the other 2:
-XX:MaxGCPauseMillis=500
-XX:SurvivorRatio=16

but I don't see a noticeable difference.

Re: Modifying Garbage Collection to increase performance

Sun Sep 01, 2013 7:04 pm

Ty for your research, I have annotated appropriately.

What version of java are you running btw?

Re: Modifying Garbage Collection to increase performance

Sun Sep 01, 2013 7:25 pm

Catachresis wrote:Ty for your research, I have annotated appropriately.

What version of java are you running btw?


Version 7, Update 25

Image

But from running the client doesn't it use its own?

Re: Modifying Garbage Collection to increase performance

Wed Nov 13, 2013 12:13 am

Holy crap I'm bad at monitoring my own thread I just saw this sorry :( Yes the OpenJDK included with the client uses a jvm 1.6 compatible runtime on windows (mac is fkd over but thats another topic) but I ran into problems with Java 7 being installed even with the client so I just wanted to make sure

Re: Modifying Garbage Collection to increase performance

Fri Nov 15, 2013 10:00 pm

Image

Nice sig!

Re: Modifying Garbage Collection to increase performance

Mon Oct 31, 2016 3:29 am

thank u

Re: Modifying Garbage Collection to increase performance

Mon Oct 31, 2016 7:40 am

yea
Post a reply