UHC Chunk Preloader
UHC Chunk Preloader
0.5.2
I have decided to release this with the listed known issues as the benefits for our games have been huge and the known issues just require more RAM for the heap and a server restart after the generation works around the issues.
Other Plugins
Minimum RAM Requirements
Bukkit / Minecraft (haven't determined which yet) has 2-3 memory leaks in the chunk generation and saving of the chunks, this causes the plugin to have specific memory requirements so it is able to finish otherwise the mod will get stuck in a safety loop I have put in waiting for the objects to be dereferenced.
! We are currently running tests on a processor that does double the MIPS then the Q6600 and we are seeing 66-75% improvements on time frames for the plugin to run, so your results may be very different. Give you an example a 2600k runs 3x MIPS then the Q6600. !
All tests were done on my workstation with the test environment on it and the following stats:
- OS: Windows 7
- CPU: Core Duo Quad Core, Q6600, 2.4Ghz
- RAM: 8GB DDR
- HD: Velociraptor 10k SATA
Bukkit:
- 1.5.2-R0.1
- Ultrahardcore 2.4
- UHC Handler 1.6
- UHC TeamBuilder 1.0
World
Radius | Chunks | Time Elapsed | XMX Value |
---|---|---|---|
500 | 4096 | 3min | 1024M |
1000 | 16129 | 9min | 1024M |
1500 | 35721 | 23min | 1536M |
2000 | 63504 | 56min | 2560M |
2500 | 98596 | 1h 24min | 4096M |
Nether
Radius | Chunks | Time Elapsed | XMX Value |
---|---|---|---|
500 | 4096 | 3min | 1024M |
1000 | 16129 | 9min | 1024M |
1500 | 35721 | 23min | 1024M |
2000 | 63504 | 56min | 2560M |
2500 | 98596 | 1h 24min | 4096M |
Current Performance of Plugin
Below are the graphs at the current stage of performance, since you can run this plugin before the game giving you the admin as much information as possible for how long you have to run the commands will give the best user experience (these graphs are based on the overworld).
Usage
Please make sure to follow all the steps.
- Start your craftbukkit server with the XMX set to at least the minimum value from the charts above
- Make sure there are no players logged in
- Type the command /ChunkPreloader world radius 0 0 (world is the name of the world, radius is the size of your radius, 0 0 is the center x,z coordinates you want
- Wait until it is finished
- Shutdown server
- Repeat steps 1-4 for world_nether
- Start server and get ready to play
Reload does not clear the memory usage a restart of the java jar is required.
Command
ChunkPreloader [world] [radius] [x] [z] [border (true/false)] FORCE
I would only recommend running this as the console, every time players have been logged in at some point they get booted by the server (most of the time right away).
- world, is the name of your world usually this will be world and world_nether
- radius, how much you want to render
- x z, the center coordinates you wish to render on
- border, if you put true here the chunkpreloader will spawn a square border around your radius in bedrock after chunkloading is done.
- FORCE, optional argument forces the plugin to run the command even though it wasn't sent from the console
Known Issues
Memory Leaks
There are three objects that are not being properly dereferenced after the chunks are completely unloaded, this causes the GC not to be able to collect them. Two of them seem to be related to the generation of new chunks, and may even be that one object isn't being dereferenced and cascading to the second object. The third is related to the FileIOThread which seems to be keeping a list of data around after it is needed.
FileIOThread Crash
Below is a screenshot of a FileIOThread crashing, you would think this would be bad, I have not actually seen any negative effects to this. Infact I have seen the opposite (which makes sense). The crash clears up one of the memory leaks, Bukkit/Minecraft starts back up the thread and all the locked heap is still available. If you see any negative effects, please let me know. I suspect once I find a work around for the memory leaks this issue will no longer occur.
Documentation Archive
Version 0.3.1 | Version 0.5.2 |
...OK, you know what? You want my advice? DON'T USE THIS PIECE OF .... Not only does it leak gigabytes of RAM, it doesn't even work as advertised.
Just forget it. Go and download WorldBorder instead and use its Fill command. As a bonus, WorldBorder works beautifully together with DynMap. It doesn't leak memory, and you can even continue to use your server while it runs.
After slogging my way through a massive pre-generation (6000 block radius around the origin of my main overworld, 3000 block radius around the origin of the secondary overworld), I'm now re-mapping my world with DynMap, and ... either there's something I don't understand about how DynMap determines which chunks exist, or UHC ChunkPreloader fully loaded only one chunk per region and called that good enough. If that is correct, then not to put too fine a point on it, this is not what it was claimed to do.
I'm trying this out on my 1.7.10 KCauldron server and so far it seems to be working OK in test. Thank you thank you thank you! I've been looking for something like this for years!
Just one thing I'd like to ask for confirmation of my understanding on: The starting point x,y is in BLOCKS (i.e. normal Minecraft coordinates)
but the radius is in CHUNKS, correct?....Never mind, looking more closely at the output I can see it is calculating the radius in blocks as well.
On my server with -Xmx16G -Xms4G and a hundred or so mods, it seems like the memory leakage starts to really cripple it after about four thousand chunks, and I start seeing this:
[12:06:06 INFO]: [UHC_Chunk_Preloader] Free memory in heap below threshold, waiting 30 seconds [12:06:06 INFO]: [UHC_Chunk_Preloader] Free (%): 0.13920088112354279 [12:06:42 INFO]: [UHC_Chunk_Preloader] Free memory in heap below threshold, waiting 30 seconds [12:06:42 INFO]: [UHC_Chunk_Preloader] Free (%): 0.13920027390122414 [12:07:19 INFO]: [UHC_Chunk_Preloader] Free memory in heap below threshold, waiting 30 seconds [12:07:19 INFO]: [UHC_Chunk_Preloader] Free (%): 0.13919932395219803 [12:07:56 INFO]: [UHC_Chunk_Preloader] Free memory in heap below threshold, waiting 30 seconds [12:07:56 INFO]: [UHC_Chunk_Preloader] Free (%): 0.13929345272481441
The curious thing is, I'm only showing about 5GB of resident memory in use when it grinds to a halt.
Looks like it might be a good plan to preload in calculated regions not to exceed about 3000 chunks at a time. A radius of 400 blocks should work out at 2500 chunks at a time. Now if I could just come up with a way to automate this...
About the memory leaks: As a workaround, might you possibly be able to create a manager thread and a chunkloader thread, and have the chunkloader thread automatically exit after 1000 chunks or so and the manager thread restart it with the next 1000 scheduled chunks?
Spigot 1649... looks quite patchy....
Works on Spigot 1.8 just fine^^
Works on 1.7.10 bukkit, I typed ChunkPreloader world 1000 0 0 true FORCE In console and it started generating the chunks! thank you so much :) BTW you might get booted off
what do i type at force?
This doesn't seem to work with 1.7.2. Might be Bukkit's fault because the 1.7 builds aren't "stable." Anyways, the generation for 1k radius does seem the same amount of time as said in the charts, however, it uses up way more RAM (I gave it 2.5Gb and it still maxed it out.) Near the end it would say "Free memory in heap below threshold, ..." And it would get to the point where it wouldn't generate many chunks between those messages. In my first attempt (with only 1Gb of RAM), eventually the preloading stopped and these messages would constantly appear every 30 seconds.
I managed to get the plugin to finish preloading and I checked the region files and noticed almost all were 24kb in size. I opened the map with BiomePainter in order to view the regions, and I saw that there were four chunks evenly spaced near the edges that were generated, and the rest was black (not generated.)
@cdutka
We have this same issue as toxic. we gave it 4gb and nothing else was running on the pc.
Hi there.
1) Your soft seems works for me. All the others soft didn't. So, a big thanks. I want generate chunk for my MCPC+ 1.6.2 server (bukkit & forge-804). The generation of chunk with your soft is make with my mod and plugins yes ? I mean, I have ExtrabiomeXL and Dungeon mod, when I click "generate", I'll have chunk with ExtrabiomeXL and Dungeon right ?
2) My server is on verygames, they have a lot of ram, you advice me somthing for optimize my server with your soft in this condition ?
Good day !
@toxictroop
What are the system specs for the server? How much ram are you giving it? Do you have anything else running on the server that could be interfering with the server? This is a high CPU / RAM usage mod.
2013-11-27 15:36:04 [INFO] [UHC Chunk Preloader] Generating Chunks for X: -153 Z: -1001 to 1017 2013-11-27 15:36:06 [INFO] [UHC Chunk Preloader] Generating Chunks for X: -137 Z: -1001 to 1017 2013-11-27 15:36:06 [INFO] [UHC Chunk Preloader] Generating Chunks for X: -121 Z: -1001 to 1017 2013-11-27 15:36:08 [INFO] [UHC Chunk Preloader] Generating Chunks for X: -105 Z: -1001 to 1017 2013-11-27 15:36:09 [INFO] [UHC Chunk Preloader] Generating Chunks for X: -89 Z: -1001 to 1017 2013-11-27 15:36:10 [INFO] [UHC Chunk Preloader] Generating Chunks for X: -73 Z: -1001 to 1017 2013-11-27 15:36:10 [INFO] [UHC Chunk Preloader] Generating Chunks for X: -57 Z: -1001 to 1017 2013-11-27 15:36:11 [SEVERE] The server has stopped responding! 2013-11-27 15:36:11 [SEVERE] Please report this to http://www.spigotmc.org/
@cdutka
Thanks much appreciated ^_^
@toxictroop
You are missing the border argument true if you want one, false if you don't
ChunkPreloader Hungergames 500 0 0 false
ChunkPreloader Hungergames 500 0 0
15:23:49 [INFO] [UHC Chunk Preloader] Error incorrect number of arguments 15:23:49 [INFO] ChunkPreloader [world] [radius] [x] [z] [border] [FORCE]
Am I doing something wrong?
I just noticed I messed up the usage documentation, I have corrected it if you are having problems running the command please check the usage again. I apologize for this mistake.
i am gonna say a simple word for this plugin: A W E S O M E ! ! ! ! !
@joker5914
Thank you for your kind words, the plugin isn't forgot I have found that in 1.6 the memory leaks have gotten slightly worse. I use this plugin myself on a weekly basis so as updates are needed or the plugin can improve I will be updating it.
Right now I am working on two new plugins, one is about 1/2 done and I just finished designing the second. Over the next 3 months I have a lot coming for all 4 of my plugins :)
I respect people in the world dedicated to making plugins that perform like this one. Never give up on this plugin, someday it'll come back to reward you for helping everyone else out.