View unanswered posts | View active topics It is currently Sat Jul 22, 2017 1:49 am



Welcome
Welcome to XP-Waste!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!


Reply to topic  [ 10 posts ] 
 Modifying Garbage Collection to increase performance 
Author Message

Joined: Thu Mar 28, 2013 9:27 am
Posts: 229
RSN: Olivia Wilde
Post Modifying Garbage Collection to increase performance
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

_________________
Image

ImageImage

Image



Mon Jul 29, 2013 2:18 pm
Profile

Joined: Thu Mar 28, 2013 9:27 am
Posts: 229
RSN: Olivia Wilde
Post Re: Modifying Garbage Collection to increase performance
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

_________________
Image

ImageImage

Image



Sun Sep 01, 2013 8:04 am
Profile

Joined: Thu Mar 28, 2013 9:27 am
Posts: 229
RSN: Olivia Wilde
Post Re: Modifying Garbage Collection to increase performance
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.

_________________
Image

ImageImage

Image



Sun Sep 01, 2013 2:50 pm
Profile

Joined: Sat Jun 09, 2012 11:57 am
Posts: 9
RSN: Marky Mark
Post Re: Modifying Garbage Collection to increase performance
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.

_________________
Image


Sun Sep 01, 2013 4:08 pm
Profile

Joined: Thu Mar 28, 2013 9:27 am
Posts: 229
RSN: Olivia Wilde
Post Re: Modifying Garbage Collection to increase performance
Ty for your research, I have annotated appropriately.

What version of java are you running btw?

_________________
Image

ImageImage

Image



Sun Sep 01, 2013 7:04 pm
Profile

Joined: Sat Jun 09, 2012 11:57 am
Posts: 9
RSN: Marky Mark
Post Re: Modifying Garbage Collection to increase performance
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?

_________________
Image


Sun Sep 01, 2013 7:25 pm
Profile

Joined: Thu Mar 28, 2013 9:27 am
Posts: 229
RSN: Olivia Wilde
Post Re: Modifying Garbage Collection to increase performance
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

_________________
Image

ImageImage

Image



Wed Nov 13, 2013 12:13 am
Profile
DGS Reviewer
DGS Reviewer

Joined: Mon Nov 05, 2012 10:12 pm
Posts: 490
Location: Souf Afrika
RSN: Corrupt Idea
Post Re: Modifying Garbage Collection to increase performance
Image

Nice sig!

_________________
ImageImageImageImageImageImageImageImageImageImage


Fri Nov 15, 2013 10:00 pm
Profile
Meme Team
Meme Team

Joined: Mon Nov 11, 2013 3:02 pm
Posts: 22
RSN: Colob
Post Re: Modifying Garbage Collection to increase performance
thank u

_________________
yh lasagna


Mon Oct 31, 2016 3:29 am
Profile
Meme Team
Meme Team
User avatar

Joined: Sat Apr 28, 2012 11:48 am
Posts: 2913
RSN: Ctediz
Post Re: Modifying Garbage Collection to increase performance
yea

_________________
ImageImage
Image
Image
Image


Mon Oct 31, 2016 7:40 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred