Possible solution:
OptiFine
You can download OptiFine here.
OptiFine is a great way of getting rid of lagg spikes, and has a lot of settings to adjust, and could possibly remove your lagg spikes, try to put everything off, or as low as possible, or just adjust it to your likings, also if you go to the setting called Other...
you should see an option called Autosave
, put it on 30m
and it should happen less frequently.
Allocating more RAM to Minecraft
This one depends on the amount of RAM you have available, the more RAM you have, the better it runs, as Minecraft uses quite a lot of it, and allowing it to use more can make it run smoother.
Start the Minecraft Launcher and then go to Edit Profile
. You should now see all the way down an option called JVM Arguments
, enable it, and write the following: -Xmx2G -Xmn128M
. If -Xmx
or -Xmn
is already in there, remove those. What this will do is allow Minecraft to allocate up to 2GB RAM to your Minecraft when you start it up, and it will always run with at least 128MB.
Of course this depends on how much RAM you have, if you only have 2GB RAM on your PC/Laptop then I strongly suggest you run it with -Xmx1G -Xmn64M
And if you have more, I suggest you locate at least half of the RAM you have. Make sure that you don't locate all of your RAM to Minecraft, or other applications might not work anymore or freeze, they might even crash.
Note that in order to allocate more than 1.8G of RAM to Minecraft (or any java program) you require a 64-bit computer with 64-bit java. (The minimalist JRE that the more recent Windows versions of Minecraft install automatically will be 64 bit if your system supports it.)
Turn off all/some of your applications
When playing Minecraft, I strongly suggest you turn off most of, or all of your applications so it will run as smoothly as possible, because Minecraft isn't the only program that eats your RAM.
Increasing process priority
I recommend not doing this, but if your computer is really that bad, and you know what you're doing then you should continue reading this option.
When you're in your Task Manager, on Windows 8(.1) you should see all of your applications currently running, click on More details
and then when you located Minecraft, right click it, and hover over to the option Go to details
or something similar looking like that, and you should now see the java process highlighted, right click it, and hover over Priority
or something similar looking, and click on the second highest option, as Realtime could crash your PC/Laptop or whatever OS you are using, you should be good to go now!
Note: The priority option could bring issues like some programs not responding/freezing so I recommend to keep Task Manager open to change this at anytime.
Best Answer
A basic troubleshooting guide(by no means conclusive, and based on personal experience): For determining the actual cause, try changing settings, disabling/enabling mods, and seeing if anything changes. If it changes for the better, you're going in the right direction. Minecraft has so many different aspects, it's very hard to figure out the exact problem.
Step 1: Know your mods. Certain mods will interact badly with each other, e.g. Logistics pipes and EE2, when hooked up together, make a lot of lag. Step 2: As you mentioned, RAM is important. Everything depends on how many mods you are running, how many players you have, how many dimensions and chunks etc. If you haven't dedicated enough RAM, or have used the wrong arguments, you'll be slow on everything. For reference, the right way to dedicate the RAM is: -Xmx[amount of memory maximum, followed by the measurement of it, e.g. 4G, 512M] -Xms[amount of memory minimum, same format]
Step 3: As previously mentioned, certain devices can cause lag. Get notifications on your server saying that 'lag causing devices will be removed, and the player who owns them may be punished', or something to a similar effect. If this doesn't work, consider a world reset.
Step 4: If none of the above options are effective, consider investing in better hardware, or a server hosting provider with a good reputation and non-ripoff prices. CreeperHost is apparently very good, but I've never personally used them. Good luck!
Side note: a Hexxit server on a Pi? You can run a vanilla MC server on a Pi without too much difficulty, but Hexxit... Not optimistic.