Sign in to follow this  
permo

Make wurm use more memory, if availible, by it self

Recommended Posts

From personal experience I can just say that I get a much more stable and lag free - in fact totally lag free - gameplay if i run "javaws.exe -J-Xmx(type your preferred max memory amount)m http://www.wurmonline.com/client/wurmclient.jnlp" in a prompt comparing to a straight up client, which i guess only use maximum 1gb as that is java standard. 


 


I'm sure most of you already fixed this by yourself but its weird that this isnt more clear in the client, or where ever, because i know there are people playing with unnecessary hickups, i was there myself.


Edited by permo
  • Like 3

Share this post


Link to post
Share on other sites

I'm not very literate in this sort of thing, but Wurm gets all the way up to 4gb used for me, or is that something different? (At 4gb it lags m computer hard to death...)


Share this post


Link to post
Share on other sites

I'm not very literate in this sort of thing, but Wurm gets all the way up to 4gb used for me, or is that something different? (At 4gb it lags m computer hard to death...)

  • Like 1

Share this post


Link to post
Share on other sites

From personal experience I can just say that I get a much more stable and lag free - in fact totally lag free - gameplay if i run "javaws.exe -J-Xmx(type your memory amount)m http://www.wurmonline.com/client/wurmclient.jnlp" comparing to a straight up client, which i guess only use maximum 1gb as that is java standard. 

 

I'm sure most of you already fixed this by yourself but its weird that this isnt more clear in the client, or where ever, because i know there are people playing with unnecessary hickups, i was there myself.

  • Like 1

Share this post


Link to post
Share on other sites

well maybe something is wrong on my end, when i just open a new client, but it seems that more people might have java maxing out at 1GB when i see all the problem with lag that people describe after being on for awhile etc

Edited by Shrimpiie

Share this post


Link to post
Share on other sites

Aye, I use a .bat file that runs the Unstable client at 4GB.



"C:\Program Files\Java\jre7\bin\Javaws.exe" -J-Xmx4096m http://www.wurmonline.com/client/wurmclient_unstable.jnlp

You can also use wurmclient.jnlp, for the regular client, or wurmclient_test.jnlp for the test client.


Edited by Xallo
  • Like 1

Share this post


Link to post
Share on other sites

Mine's running with only 800 mb too, which forces me to run low-mid with a pretty hefty machine.


 


I tried your code with the wurmclient but I'm getting this error. :(


 


f-angel534432060015ff16.jpg


Share this post


Link to post
Share on other sites

I remember setting the memory with the command like parameter like this helped mitigate the stuttering we got when character animations were just recently implemented, but nowadays it makes no difference on my end. Now and in the past the game clients are always able (and mostly does) allocate >1GB of memory, the exact amount depending on the settings. Though there's probably some difference in our systems, because I don't get memory leaks either.

Share this post


Link to post
Share on other sites

Contrary to popular belief, wurm is not suffering from a memory leak that makes the heap grow so large so as to exhaust all the memory it is allowed to allocate. If you profile the application with a profiler you will see that the Garbage Collector is not performing FullGC circles regularly to cause the rest of the threads to pause. Also keep in mind the xmx parameter defines the maximum allowed heap size that the Virtual Machine can grow at, it doesn't mean it will use it.


 


When you see that 1+ GB of memory being used by the JVM in your Task Manager that doesn't mean that it constantly uses that memory but that it needed it once, allocated it and then it didn't deallocate ( the memory manager decided that it might be used in the future ).


 


In my opinion ( not sure yet ), the lag you notice after playing for extended amount of time and after travelling a lot is by world objects not getting properly removed from the World the client percieves. This can happen in many ways ( the same way names stuck in local for example ) due to packet loss, data racing and such. The client ends up having a lot of objects that are not in Local anymore and not needed. Those objects are being iterated through the game circle and hog the CPU when they become too many.


 


So all in all, adding more max memory in the jnlp won't help in anything.


 


My humble opinion :P


 


PS: Keep in mind this type of resource leak is very common in game clients due to programming mistakes. Aion and Lineage 2 game clients are also known to leak resources like this and need a regular client restart after a couple of hours. It's just that the wurm client handles much more more more object due to it's sandbox nature. Most RPG's have a solid world and scatered creatures and items. In wurm all walls, tiles, trees, animals, items they are all objects in the world.


Edited by Issle
  • Like 4

Share this post


Link to post
Share on other sites

Contrary to popular belief, wurm is not suffering from a memory leak that makes the heap grow so large so as to exhaust all the memory it is allowed to allocate. If you profile the application with a profiler you will see that the Garbage Collector is not performing FullGC circles regularly to cause the rest of the threads to pause. Also keep in mind the xmx parameter defines the maximum allowed heap size that the Virtual Machine can grow at, it doesn't mean it will use it.

 

When you see that 1+ GB of memory being used by the JVM in your Task Manager that doesn't mean that it constantly uses that memory but that it needed it once, allocated it and then it didn't deallocate ( the memory manager decided that it might be used in the future ).

 

In my opinion ( not sure yet ), the lag you notice after playing for extended amount of time and after travelling a lot is by world objects not getting properly removed from the World the client percieves. This can happen in many ways ( the same way names stuck in local for example ) due to packet loss, data racing and such. The client ends up having a lot of objects that are not in Local anymore and not needed. Those objects are being iterated through the game circle and hog the CPU when they become too many.

 

So all in all, adding more max memory in the jnlp won't help in anything.

 

My humble opinion :P

 

PS: Keep in mind this type of resource leak is very common in game clients due to programming mistakes. Aion and Lineage 2 game clients are also known to leak resources like this and need a regular client restart after a couple of hours. It's just that the wurm client handles much more more more object due to it's sandbox nature. Most RPG's have a solid world and scatered creatures and items. In wurm all walls, tiles, trees, animals, items they are all objects in the world.

 

I swear it helped me. Before I could roam the map for max 1h before i needed a restart. Now, I never need to. But that's maybe just something f:ed up on my end, this isnt my expertice.

Edited by permo

Share this post


Link to post
Share on other sites

I was currently testing at my deed. Memory usage , 250 MB, xmx 800MB. Was lagging like ###### after an hour with those numbers even if the memory usage was way bellow the max. What I've noticed is that the main thread, the one that executes the game update loop is always at 100% of its core. This is when the lagging starts to happen because the loop can't update fast enough to produce the framerate.


Edited by Issle

Share this post


Link to post
Share on other sites

I was currently testing at my deed. Memory usage , 250 MB, xmx 800MB. Was lagging like ###### after an hour with those numbers. 

 

I have it at 6144

Share this post


Link to post
Share on other sites

It's an overkill in my opinion. Since Java is memory hungry and you allow it to allocate that much memory it actually will. That's memory that other apps could use.


Share this post


Link to post
Share on other sites

Someone needs to tutorial this step by step for the idiots like me. I have a strong feeling this might help me but am not even sure what to do. Don't wanna screw it up, either.

Share this post


Link to post
Share on other sites

If you really needed to configure those settings the devs would have done that for you inside the jnlp. The default settings are fine.


  • Like 1

Share this post


Link to post
Share on other sites

I realize that testimonial evidence is worthless but i swear its like day and night for me, so I would think its worth a shot for others.


  • Like 1

Share this post


Link to post
Share on other sites

Issle's spot on.   As the object list in the client gets longer then certain scheduled or triggered tasks (should I draw this, can you open that) take longer and longer as it has to walk longer and longer lists.


 


It's counter intuitive but more memory can be very counter productive.  The optimal memory is 'just enough' too little and you thrash, too much and you prevent culling of uneeded cruft.


 


In general, for most computing and networks problems, more memory increases bandwidth and increases latency.  If you have a task that needs more throughput more memory can help but costs you added latency.  Less memory can improve latency but reduces throughput.    If you're lagging at a given memory consumption what you need is less consumption or faster memory.  More memory will just make you lag harder a little later on.


  • Like 2

Share this post


Link to post
Share on other sites

If you really needed to configure those settings the devs would have done that for you inside the jnlp. The default settings are fine.

Things are often overlooked by our dev team... and this is a java "issue", not a Wurm "issue", even more reason it might have been overlooked.

Share this post


Link to post
Share on other sites

Just to be clear i didnt give it all my ram. I have 8GB but set it at 6. 6 is just a random amount i picked which, for me, helped alot so didnt try other numbers out.


Share this post


Link to post
Share on other sites

I think more people who complain about lag during alot of ppl in local should try this out. Even if you dont think it will help there isnt any downside to adding this suffix to your launcher, and test the difference yourself. My wurm experience has quadrupoly improved since and yesterday i was raiding for hours (loads of all kinds of actions in event/terraforming/~40 in local/pvp/roaming etc.) which earlier most def. would have lead to +10 relogs, even with lowered settings, but now it played silky smooth at highest graphics.


 


And if you notice any difference please share so that more folks can see this "fix".


Edited by permo

Share this post


Link to post
Share on other sites

I think more people who complain about lag during alot of ppl in local should try this out. Even if you dont think it will help there isnt any downside to adding this suffix to your launcher, and test the difference yourself. My wurm experience has quadrupoly improved since and yesterday i was raiding for hours (loads of all kinds of actions in event/terraforming/~40 in local/pvp/roaming etc.) which earlier most def. would have lead to +10 relogs, even with lowered settings, but now it played silky smooth at highest graphics.

 

And if you notice any difference please share so that more folks can see this "fix".

 

I've been using this for like a month or so, and normally it's great, I get very little lag, pvp is usually smooth, takes a bit to need to relog unless I run around a bit.  But today... was just a mess, a slideshow

Share this post


Link to post
Share on other sites

Test Environment: Xanadu spawn points.


Results:


  • High CPU usage causing frame lags
  • Memory slowly leaking and getting double over the course of an hour.

JO5rEkY.pngSeems I was wrong, memory is leaking after all. But very slowly. But still for a sandbox, the memory usage is surprisingly low. It's amazing how the client would be able to run with just 250 mb if it weren't for the leaks. The blue spikes are Full memory garbage collection issued manually.


 


What is interesting is that the memory started leaking at around 11:40. This is when I ported at spawn point #2 when the gms were spawning the zombies and the avatars causing lots of combat. It seems that it is some combat aspect that makes the memory leak heavily.


Edited by Issle
  • Like 2

Share this post


Link to post
Share on other sites

I've been using this for like a month or so, and normally it's great, I get very little lag, pvp is usually smooth, takes a bit to need to relog unless I run around a bit.  But today... was just a mess, a slideshow

 

Wasnt there today... :( But how much memory did you give it? If you have like 8gb or more test to give it like 6144 or even higher perhaps?

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