SBPrime / AsyncWorldEdit-Premium

Async WorldEdit - Edit millions of blocks without lag! (Premium version)
Other
19 stars 4 forks source link

Server Running Out of Memory (RAM) #168

Closed LucidusMC closed 5 years ago

LucidusMC commented 5 years ago

AsyncWorldEdit - Premium 3.6.0-rc-05 worldedit-bukkit-7.0.0-beta-05.jar Paper/Spigot 1.13.2

I am very sorry if this is repeat, but I am having a hard time understanding how to prevent my server from running out of memory. I have tried Paper and Spigot 1.13.2 and both always end up running out of memory and unable to perform the queue. I have done it on a 2GB server, 4GB Server and a local server with 8GB. If I perform a series of small tasks over and over or if I import a large schematic, they both result in memory loss that never recovers. Even if the small tasks are complete or the large one is as well. Is the only solution to restart my server or is there something in the config I can change?

Thanks!

SBPrime commented 5 years ago

You need to change the memory configuration in AWE config: https://github.com/SBPrime/AsyncWorldEdit/blob/master/AsyncWorldEdit/src/main/resources/config.yml#L15

You can also change the queue size (rendering queue-max-size-hard and queue-max-size-soft).

What I would suggest: load the schematic, check how much free ram you have and configure AWE around that. Also if you don't need to undo the paste you can disable undo.

LucidusMC commented 5 years ago

Ok, so I did try setting those, doesn't seem to fix the issue, even if I set them really low. I will try again, but I expect the same result. Will report back. Thanks.

LucidusMC commented 5 years ago

Could you possibly make a dummies guide to memory settings for your plugin? Maybe two parts, one for hosted servers and one for self hosted ones? Would be super helpful for us less knowledgeable server owners. Thanks.

SBPrime commented 5 years ago

Before I continue, I remembered one thing, what was the error exactly (message + stack)?

LucidusMC commented 5 years ago

TBH, my server and queue just ground to a halt, no errors, etc.

SBPrime commented 5 years ago

Sorry but I don't understand. So you did not get a out of memory error? simply the operations started going slow? How did you measure the memory usage? Was there nothing on the console? How much free (not declared) ram you have after startup? How large ware the edits/schematics (in blocks and in X,Z?

LucidusMC commented 5 years ago

I watched via multicraft on my hosted server, the queue kept stopping, on my localhost server my allocated ram was used up by the queue as well. Then things ground to a halt on both. No official console errors. How do I avoid this scenario? First server I had 3.5gb second sever 5.4gb. I did two kinds of edits, one was a series of smaller ones repeated, eventually even after they are complete the memory never recovers, it stays used up, the second one was a very large schematic, same result or it would throttle before completing. In other words any size of the operation always leads to running out of memory and server throttling.

Unfortunately because I don't get any errors I feel it is my lack of understanding of how to setup the config that is causing this. That is why I was hoping for a "how to".

SBPrime commented 5 years ago

Ok, but what exactly do you mean by memory usage? Usage on the machine? Usage by the java process? Could you check the memory usage using essential? What is the free memory after server startup? II tested this extensively, if you are not using memory undo the ram goes down after couple of seconds after the operation finishes. Please send me your current AWE config.

LucidusMC commented 5 years ago

Yes, server memory runs out, allocated memory is always only at about 10% use when I start. By the time I am done running WE commands I have zero available. The server never crashes. But the allocated memory always stays to 100% in use and never returns to typical 10%. It's odd. The awe config is default. I don't have it loaded at the time, sorry. (I really think this is a config issue on my part, I don't want you to feel obligated to help me as far as that goes, but I think for newbies like me a guide would be great, maybe with real world config example? Like, my server has 4gb of ram allocated. On server idle 500mb is used up before running WE commands, to avoid throttling and running out of queue here are some common settings you would change...) I think you have something like that but it's not in a way someone like me could understand, or maybe I missed it?

SBPrime commented 5 years ago

Could you send me the output of mem (gc) command?

LucidusMC commented 5 years ago

Messed around with the settings, things seem to settle down now after the job is completed. Must have the config closer to what is needed for my server (still not 100% what each setting does...). Thanks for your patience and help. Would still love a dummies guide!

SBPrime commented 5 years ago

Well I already have the section how many blocks you can queue, the problem is that its always individual case.

LucidusMC commented 5 years ago

Everything is running great now, pasted a very large schematic no issues, ram returned to normal and no lag, just had to trial and error until I found settings that worked. You can close this now, if I have another issue I will open another ticket. Thanks!