Sign in to follow this  
Steveleeb

Reduce micro-freezes / j10?

Recommended Posts

The micro freezes that Wurm Online suffers im told is an OpenGL issue that's promised to be fixed in their next update so it isn't being addressed by Codeclub.
This is what i have been told.
Unfortunately it's been some time, it got to the point where it was putting me off the game.
Most people are using Java 8, fortunately Java 10 reduces the problem to barely noticeable levels. So i now run Wurm Online with Java 10.
it's worth mentioning that my framerates climbed by 10fps when i did so.
(you have to create an oracle account to download the J10 runtime so i threw it on my google drive for friends)
that said, this is the download page - https://www.oracle.com/java/technologies/java-archive-javase10-downloads.html

Now for Wurm Unlimited.. unfortunately WU comes with it's own redist located here;
Ihr4815.jpg

I tried simply copying J10 from my /program files/java directory.. the front end wouldn't even load and i had to re-verify all files.
This is a steam thing, could anyone be kind enough to explain how i might be able to force WU to use my Java 10 installation?

Edited by Steveleeb

Share this post


Link to post
Share on other sites

Java 10 is not an LTS version, currently Java 11 is what you should be using right now, followed by Java 17 next year.

 

I am not sure how to change that client side, I only know how to do it server side.

Maybe the client mod loader has an option to do so, but I am not sure, the server modloader does have an option for sure.

  • Like 1

Share this post


Link to post
Share on other sites

Client mod loader Instructions

* Unzip the contents of client-modlauncher-<version>.zip into the "WurmLauncher" folder

* Unzip the contents of the individual mods you want to run into the "WurmLauncher" folder. This adds the required .properties files to enable the mods.

* Run patcher.bat

* Start Wurm from Steam

 

the patcher.bat contains this:  
<..\runtime\bin\java -classpath patcher.jar;javassist.jar org.gotti.wurmunlimited.patcher.PatchClientJar
pause>

Which seems to suggest it depends on the java redist that steam insists on using. (because that's the directory it points to)
seeing that java itself isn't a mod, i think there's no option to force the version i have in my \programfiles\java directory.
I  considered once again copying the contents of \programfiles\java into \runtime\bin\jav THEN running the patcher .. this i might try what do you think?
I could not find development kits for anything above J10, the latest runtime i could find is J10.
Im confident that the version Wurm Unlimited is using within the \runtime\bin\java folder is 8. which is a big problem.
Are you saying that this will change one day? because if CC have halted development on WU (they won't even import the new keybinds), then i don't see it happening.

Edited by Steveleeb
final edit done

Share this post


Link to post
Share on other sites

LaunchConfig.ini allows you to override the Java path

 

[Runtime]
OverrideDefaultJavaPath=false
JavaPath=

 

patcher.bat uses the Java that is shipped to every WU user by default. I don't think there is any hard dependency on Java 8 in the patcher. So you can replace the path in patcher.bat.

Going to Java 10 or 11 may break some mods however. At least the scriptrunner (server) mod and anything that depends on it may break because Oracle decided to deprecated the integrated Javascript runtime.

 

I'd advise to first try to get vanilla WU to work by adjusting the path in LaunchConfig.ini. If this works properly you can try to get it to run with the modloader.

 

  • Like 1

Share this post


Link to post
Share on other sites

thank you for attending to the thread that is highly helpful :)
When i change <OverrideDefaultJavaPath=false> to <OverrideDefaultJavaPath=true> this pops up  when i run it;

Spoiler

kmwmGWC.jpg

then it'd close and nul.
So,
<OverrideDefaultJavaPath=false>
<JavaPath=C:\Program Files\Java>
i'm going to go with this and see how it goes.


edit - I'm fairly certain the override needs to be set to true.

How do make it recognise my native java directory when the above fails to do so?
To clarify -


[Runtime]
OverrideDefaultJavaPath=true
JavaPath=C:\Program Files\Java\
[Memory]
InitialHeap=512m
MaxHeapSize=8184m
[VMParams]
JvmParam0=-XX:+AggressiveOpts


results in the screenshot

Edited by Steveleeb

Share this post


Link to post
Share on other sites
[Runtime]
OverrideDefaultJavaPath=true
JavaPath=C:\Program Files\Java\jre1.8.0_231\bin\server
[Memory]
InitialHeap=512m
MaxHeapSize=2048m
[VMParams]
JvmParam0=-XX:+AggressiveOpts

JavaPath must point to the directory with jvm.dll or libjvm.so on linux

I haven't tested it with Java 10, just the Java 8 i had installed anyway.

Share this post


Link to post
Share on other sites

And to follow up from the PM: Java 10 is crashing because its missing the JavaFX libraries.

 

This exactly what I was expecting. WU is not prepared to run on Java 10. Someone with some skill can probably get it to run by adding the missing libraries to Java or WU. But I don't plan to sink any time into tinkering how to get WU to run in Java 10.

 

Hint: Search for how to get JavaFX on Java 10

  • Like 1

Share this post


Link to post
Share on other sites

The greatest fix so far, seems to be setting the min and max heap size as equal numbers.
[Runtime]
OverrideDefaultJavaPath=false
JavaPath=
[Memory]
InitialHeap=4096m
MaxHeapSize=4096m
[VMParams]
JvmParam0=-XX:+AggressiveOpts
JvmParam1=-Xms4096M
JvmParam2=-Xmx4096M


This seems to prevent the garbage collector from needing to run, the 4GB i've set it is just for experimental purposes, great if you have 16GB and run 3 chars in unison. Change the figure if you need to but keep them the same as each other.
The [Memory] section seemed to be ignored so i added the classic arguments as well.

Edited by Steveleeb

Share this post


Link to post
Share on other sites
On 3/10/2020 at 2:35 AM, Steveleeb said:

The greatest fix so far, seems to be setting the min and max heap size as equal numbers.
[Runtime]
OverrideDefaultJavaPath=false
JavaPath=
[Memory]
InitialHeap=4096m
MaxHeapSize=4096m
[VMParams]
JvmParam0=-XX:+AggressiveOpts
JvmParam1=-Xms4096M
JvmParam2=-Xmx4096M


This seems to prevent the garbage collector from needing to run, the 4GB i've set it is just for experimental purposes, great if you have 16GB and run 3 chars in unison. Change the figure if you need to but keep them the same as each other.
The [Memory] section seemed to be ignored so i added the classic arguments as well.

 

Hello, where do I edit such file on Wurm Online (Steam client)? There is no LaunchConfig.ini.
I am also having these micro freezes, the steam client uses java runtime 8 apparently.

Edited by Kian

Share this post


Link to post
Share on other sites

Im not sure if WO uses your windows java or its own installation thesedays.
but, if it uses what you installed on Windows, head to your java control panel (see image) and type in runtime parameters.
7fsxTYy.jpg

There are other ways but hopefully you have access to this interface. If you can't find the control panel applet, from cmd.exe its location is here <JRE installation home> \bin\javacpl.exe
As for what to type... https://alvinalexander.com/blog/post/java/java-xmx-xms-memory-heap-size-control/
Don't worry about CLASSPATH unless you want to set it up differently for more than one app.

-Xnoclassgc   disable class garbage collection
-Xms          set initial Java heap size
-Xmx          set maximum Java heap size
-Xss          set java thread stack size

I have never tried the top one. might be worth checking out.
Someone else might, respond to your question with simpler instructions, maybe a drop down where u can simply make a choice instead of this polava but im unsure if that exists. I do feel like ive forgotten something i used to know so who knows.
There is no way to force W-U to use your native java despite overridejavapath being written and the jittering is caused by the garbage collector.
It can be programmed to happen more often in a less noticeable way or less often in a more noticeable way and is far worse in J7.
Least with WO u can use your native java which.. is upgradeable. <edit - no longer true>

Anyone else wanna chip in with an easier solution, please do.
The Minecraft Launcher (java version) makes it a little easier and might provide some insight despite its irrelevance here
https://cubedhost.com/help/en/articles/1648388-how-do-i-allocate-more-memory-to-my-minecraft-launcher-client-side

@Finnnmight be able to help, i believe there's new code that's been added into the client jnlp in recent years that you could possibly edit.
 

Edited by Steveleeb
  • Like 1

Share this post


Link to post
Share on other sites

It uses it's own java version, in that case devs would have to update the version used?

  • Like 1

Share this post


Link to post
Share on other sites

If you are sure, that Wurm Online no longer uses the windows native java but its own wrapped version, then im sorry i don't have the knowledge you need.
(this maybe occurred when the graphics engine was overhauled to accomodate swiftshader)
maybe finnn has a clue, i sent him a pm he'll respond when he sees it.

<j2se
                href="http://java.sun.com/products/autodl/j2se"
                version="1.8+"
                            java-vm-args="-XX:+UseG1GC -XX:MaxGCPauseMillis=8 -XX:+UseStringDeduplication"
                                        initial-heap-size="512m"                                 />


is a paste from the client jnlp, this is what i meant but if edited wouldn't the launcher just overwrite it everytime it launched?
i do not know, there should be an overwrite command/extension but i am unsure if it exists.
Maybe a suggestions thread is brewing
 

Edited by Steveleeb

Share this post


Link to post
Share on other sites

he replied in a pm, here's an excerpt that boils it down well.
 

Quote

Sadly all that is gone(I used to run the jnlp client with cache cleanup, maybe memory settings but that's not possible anymore)... launcher now runs the java, after the devs added the launcher.. afaik we can't do anything to make things better, at best you might be able to change OS settings/variables for java heap sizes.. but that is overwritten by launcher parameters that run java when it starts the game.

 

..best hope sadly afaik is the devs.. and to bump the thread so it's visible every 1-2 days

 

Edited by Steveleeb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this