My issue is that while playing on a survival world a lagspike happened for a reason I don't know. The game is at a complete freeze state where I can't interact with anything (place blocks, register hits on mobs, etc). When I re-join the world, it always spawns me at the original position I was even when I move around. Which is weird because re-joining has always stopped singleplayer lagspikes for me until now. I've never had a lagspike so bad where it doesn't update at least a little bit. I run minecraft at 5 RAM and I have 39 mods installed. Any ideas to fix this? I'll post a video if I absolutely have to
(I feel like I've posted this on the wrong thread. My world does have mods installed, but I don't this can be fixed by removing mods because 1, this doesn't happen when a make a new world at all, and 2, re-joining the world without said-mod is something I really don't want. Can you move post from one forum section to another?)
Something in your world is causing the issue, which is why new worlds don't have this problem. I would recommend doing some sampling with VisualVM, as it's usually quite good at finding the causes of problems like these. To use it, open it up and double click on the most minecraft-y thing listed on the left (your client has to be running for it to be listed, though the world doesn't have to be loaded just yet). For the vanilla launcher, this is listed as "net.minecraft.client.main.Main", and for MultiMC it's listed as "org.multimc.EntryPoint". Different launchers will most likely be listed differently, so use your own judgement here. There shouldn't be very many things to choose from anyway. Once you have it opened, go to the sampler tab, and wait for the lag spike to happen again. Then, start sampling the CPU and wait for ~30 seconds or so for it to collect data about what minecraft is doing. Then click on "snapshot", and open up either client thread or server thread, depending on what's lagging. If you experience low framerate or a total freeze of the application, pick client thread. If you're still able to move around normally, but mobs/tile entities/etc... are all frozen, pick server thread. It is also possible for code to be running on both threads though, so keep that in mind too. From there, you can expand the results it gives you until you find the problem.
So, what am'I suppose to do with the data from visualVM? I clicked on net.minecraft.launcherwrapper.Launch on the left, which was the only option that appeared when MC was running. I joined my world and paused, clicked on "sample", then unpaused. The server client data was completely blank, yet in my world there's nothing wrong with my FPS and MC doesn't freeze. I clicked "snapshot" and exported the file into a folder, and got a nps(?) file
Wait for the lag to actually start before you start sampling. This ensures that it only collects data about the spike itself, and not about normal things that minecraft always does. As for the .nps file, that's if you want to give your snapshot results to someone else for them to take a look at. Not particularly useful here. (unless you have no idea what to look for, in which case I can take a look for you if you upload that file to dropbox or something similar)
Your server thread seems to be spending most of its time doing nothing, and your client thread is spending more than half of its time doing native OpenGL rendering operations. Are you sure you un-paused after you started sampling? Because if you didn't, then the only results it'll get will be from rendering the pause menu, which isn't helpful. I would recommend opening the chat window or your inventory when you start sampling, instead of pausing the game.
Nearly 20% of your server thread is being used to handle and log exceptions. Log files will be necessary to find out what's throwing those. On top of that, 6% of your server thread and 12% of your client thread are being used for rendering and updating rabbit entities. I'd recommend killing as many of those as you can. Next, 11% of your client thread is being used for rendering chests. Using a more compact storage system like AE would help, though I'm not sure if AE ever got ported to 1.8 or if it just skipped straight to 1.9/1.10. Either way, I'd recommend finding a better form of storage that doesn't use as many TESRs (explanation of what those are below). After that, 10% of your client thread is being used for rendering MCA's human entities. I don't know a huge amount about that mod, but if you can get rid of some of them or live in an area that doesn't have as many within rendering distance, that would also help.
Rendering in minecraft is divided up into 2 sections: world rendering, and entity rendering. World rendering handles most blocks that are part of the terrain, and entity rendering handles entities and some tile entities. What makes these two systems different is that most blocks in the world don't move or change what they look like, while most entities do. (animated textures don't count here) The reason this matters is that things that don't change often can be cached on the GPU, but if something needs to change, then it can't use that cache anymore, so it has to re-render the entire model. For the world renderer, this only happens when a block changes, and even then it only re-renders one sub-chunk (a 16x16x16 area), not the entire world. Entities on the other hand change all the time, so their models have to be re-rendered constantly. This is significantly less efficient, and it's why looking at a lot of mobs at once will cause quite a bit of lag.
Now for Tile Entity Special Renderers (TESRs, for short): basically, a TESR is a block that can change what it looks like in the same way entities do. This includes chests, because they have an opening/closing animation. As you might have guessed, TESRs run in the entity renderer, not the world renderer. The trade-off is that while this means chests don't have to re-render the entire sub-chunk every time someone opens/closes one, they DO have to re-render themselves. Every single frame. If you have a lot of chests within rendering distance, it'll lag in the same way that having a lot of mobs in one area would.
I have a log file of my world, but what exactly should I be looking for? Should I copypaste my log file here? If yes, what section should I specifically paste? Can you give me a link to the storage mod you mentioned? Because searching on google "minecraft AE" gives me unrelated stuff that doesn't look like a storage mod. How would I be able to kill mob entities when my world is frozen? A despawn all command? That's the last thing I wanna resort to solve the lag spike
.minecraft/latest.log is the file to upload. Use pastebin for this. As usual, make sure the world has been loaded before uploading that file (don't upload it while you're still at the main menu). AE can be found here, though I checked and it doesn't have any versions available for MC1.8, and neither does Refined storage. Iron chests and storage drawers do though, and both of them would probably help. As for killing all the entities, there is indeed a command for that in 1.8 (/kill @e[type=Rabbit]), but if your world is too laggy to even use that command, it may be better to use MCEdit instead.
at com.lithial.me.enchantments.EffectManager.Magnet(EffectManager.java:123) ~[EffectManager.class:?]
at com.lithial.me.handlers.LivingHandler.LivingEvent(LivingHandler.java:106) ~[LivingHandler.class:?]
Well there's your problem. That mod is spamming that error constantly. Go report it to whoever developed that mod, and if possible, remove it in the meantime until it's fixed.
Yeah, more enchants mod is definitely the problem. I removed it from my mods folder, joined my world, and everything unfroze. But when I added it back, the world lagged again (sad fase). I messaged the mod creator and hopefully he'll respond