The Meaning of Life, the Universe, and Everything.
Location:
Toronto
Join Date:
6/11/2012
Posts:
178
Minecraft:
Eunomiac
Xbox:
Eunomiac
Member Details
Unfortunately I can't really explain this with a screen shot or a crash report, so I hope you'll forgive me if I err on the side of being too thorough
I've been enduring constant lag spikes while playing Minecraft for a while now, occuring regularly every minute or so. Most of the time they're brief hiccups, but sometimes they last so long I fear the game has frozen... until everything unfreezes and continues as if nothing happened, till the next spike.
I know it's not the lag spike of death—my autosave is every 3 mins. Also potentially important: I run Minecraft off a 512 MB RAMDisk, with 4 GB total RAM.
On the debug screen, I've noticed that these lag spikes always coincide with two things:
A single "off-the-chart" white line in the lagometer, which reaches the top of my monitor (where it's cut off). I believe this means whatever is causing these spikes somehow relates to game ticks? Occasionally there's an aftershock, too: a second, shorter white line, which follows a few ticks later. (They're very noticeable, since the rest of the lagometer is flat. It's never a group of lines spiking together—always a single, isolated white line flying up from an otherwise flat lagometer. I never see red, and the green only spikes occasionally, never by very much, and never causes a lag spike.)
A sudden, significant drop in Used Memory. This drop occurs at the end of a strange, repeating cycle: Used Memory will climb at a very steady pace, piling on the megabytes with the regularity of a stopwatch: 20%... 40%... 60%... until (usually well before reaching 100%) it suddenly plummets to a much lower percentage, where the cycle of steady growth begins again. The lag spike occurs at the peak of this cycle, right as the Used Memory drops.
I initially assumed I just needed to allocate more RAM in Magic Launcher, but allocating 2 GB (the most I tried) didn't help—and the drop in Used Memory usually hits before reaching 100%, which suggests adding more RAM isn't going to help.
A few details on my system and mods that might be helpful:
O/S: Windows 7 (64-bit, with 64-bit Java)
CPU: Intel quad core, 2.5GHz
RAM: 4 GB (the RAMDisk installation takes up 512 MB, and I've allocated 1 GB in Magic Launcher)
Graphics: NVidia GeForce GTX 560
Mods: Forge; Optifine Ultra; most of Risugami's mods; IronChests; ExtraBiomesXL; Village Info Mod; Rei's Minimap (all updated recently to 1.4.5)
Texture Pack: 64x64 Misa Realistic
4 GB of RAM total, with 512 MB to the RAMDisk plus another 1 GB allocated to Minecraft via Magic Launcher... that should leave plenty of RAM for Java and Windows to run, shouldn't it? And there's still the other half of that strange cycle: What would cause such a constant, steady increase in Used Memory, then need to cut it so urgently that it freezes the game... only to immediately restart its steady climb towards the next plummet & lag spike?
Thanks in advance for any help/advice/ideas/solutions!
Rollback Post to RevisionRollBack
Amateur dinosaur hunter and extreme weather enthusiast, whose interests include spoken mime, armchair parkour, tactical gaslighting (for fun or for pay), conspicuous ninjutsu and Schröedinger's pentameter—of which this sentence may or may not be an example.
I'm having exactly the same problem. (A sudden, significant drop in Used Memory.)And that causes a lag spike. It's happening in every 4-5 seconds. Are there any way to keep memory usage stable? Or are there anybody who can help us?
Minecraft has a memory usage pattern typical for a Java program. The used memory is slowly growing up until a limit is reached and then the garbage collector is invoked which frees all the memory which is not used. Then the cycle repeats again.
The lowest number to which the used memory falls is the real memory that the program needs, the rest is a buffer for the garbage collector so that it does not have to be invoked very often. Even this lower number is not the truth, because the garbage collector does not try very hard when there is enough memory and goes only for the easy targets in order not to use too much CPU time. It is important to notice that the garbage collector is usually not invoked before the limit is reached, even if there is huge amount of memory waiting to be freed.
The default Minecraft launcher sets a memory limit of 1 GB. This limit concerns the amount of memory that Minecraft is free to use, additionally the Java Virtual Machine needs to allocate native memory for its own purposes which adds at least 50% overhead bringing the total to 1.5 GB.
This limit should be no problem if the computer has 1.5 GB physical memory free, which means that the total physical memory should be at least 2.5 - 3 GB, the rest being used by the operating system and background processes. Only then is this 1.5 GB physical memory free for Minecraft to use.
Quite often there is less than 1.5 GB physical memory free. In this case Java will happily allocate memory above the available physical memory and the operating system will have to swap parts of the used memory to disk. This process is slow as the disk is much slower (1000x) than physical memory.
In reality Minecraft needs no more than 256 MB to run, mostly using about 100-150 MB. This is for vanilla Minecraft running in 32 bit Java with no mods installed and using the default texture pack. Any memory above this will be used for garbage collector buffer and may cause memory to be swapped to disk and generate a lot of lag.
Starting Minecraft with less memory greatly reduces the chance of swapping to disk, especially for computers with less than 3 GB memory."
Hope this helps.
Rollback Post to RevisionRollBack
I am the biggest lurker you've (n)ever seen.
To post a comment, please login or register a new account.
I've been enduring constant lag spikes while playing Minecraft for a while now, occuring regularly every minute or so. Most of the time they're brief hiccups, but sometimes they last so long I fear the game has frozen... until everything unfreezes and continues as if nothing happened, till the next spike.
I know it's not the lag spike of death—my autosave is every 3 mins. Also potentially important: I run Minecraft off a 512 MB RAMDisk, with 4 GB total RAM.
On the debug screen, I've noticed that these lag spikes always coincide with two things:
- A single "off-the-chart" white line in the lagometer, which reaches the top of my monitor (where it's cut off). I believe this means whatever is causing these spikes somehow relates to game ticks? Occasionally there's an aftershock, too: a second, shorter white line, which follows a few ticks later. (They're very noticeable, since the rest of the lagometer is flat. It's never a group of lines spiking together—always a single, isolated white line flying up from an otherwise flat lagometer. I never see red, and the green only spikes occasionally, never by very much, and never causes a lag spike.)
- A sudden, significant drop in Used Memory. This drop occurs at the end of a strange, repeating cycle: Used Memory will climb at a very steady pace, piling on the megabytes with the regularity of a stopwatch: 20%... 40%... 60%... until (usually well before reaching 100%) it suddenly plummets to a much lower percentage, where the cycle of steady growth begins again. The lag spike occurs at the peak of this cycle, right as the Used Memory drops.
I initially assumed I just needed to allocate more RAM in Magic Launcher, but allocating 2 GB (the most I tried) didn't help—and the drop in Used Memory usually hits before reaching 100%, which suggests adding more RAM isn't going to help.A few details on my system and mods that might be helpful:
- O/S: Windows 7 (64-bit, with 64-bit Java)
- CPU: Intel quad core, 2.5GHz
- RAM: 4 GB (the RAMDisk installation takes up 512 MB, and I've allocated 1 GB in Magic Launcher)
- Graphics: NVidia GeForce GTX 560
- Mods: Forge; Optifine Ultra; most of Risugami's mods; IronChests; ExtraBiomesXL; Village Info Mod; Rei's Minimap (all updated recently to 1.4.5)
- Texture Pack: 64x64 Misa Realistic
4 GB of RAM total, with 512 MB to the RAMDisk plus another 1 GB allocated to Minecraft via Magic Launcher... that should leave plenty of RAM for Java and Windows to run, shouldn't it? And there's still the other half of that strange cycle: What would cause such a constant, steady increase in Used Memory, then need to cut it so urgently that it freezes the game... only to immediately restart its steady climb towards the next plummet & lag spike?Thanks in advance for any help/advice/ideas/solutions!
-
View User Profile
-
View Posts
-
Send Message
Curse Premium"4. Memory
Minecraft has a memory usage pattern typical for a Java program. The used memory is slowly growing up until a limit is reached and then the garbage collector is invoked which frees all the memory which is not used. Then the cycle repeats again.
The lowest number to which the used memory falls is the real memory that the program needs, the rest is a buffer for the garbage collector so that it does not have to be invoked very often. Even this lower number is not the truth, because the garbage collector does not try very hard when there is enough memory and goes only for the easy targets in order not to use too much CPU time. It is important to notice that the garbage collector is usually not invoked before the limit is reached, even if there is huge amount of memory waiting to be freed.
The default Minecraft launcher sets a memory limit of 1 GB. This limit concerns the amount of memory that Minecraft is free to use, additionally the Java Virtual Machine needs to allocate native memory for its own purposes which adds at least 50% overhead bringing the total to 1.5 GB.
This limit should be no problem if the computer has 1.5 GB physical memory free, which means that the total physical memory should be at least 2.5 - 3 GB, the rest being used by the operating system and background processes. Only then is this 1.5 GB physical memory free for Minecraft to use.
Quite often there is less than 1.5 GB physical memory free. In this case Java will happily allocate memory above the available physical memory and the operating system will have to swap parts of the used memory to disk. This process is slow as the disk is much slower (1000x) than physical memory.
In reality Minecraft needs no more than 256 MB to run, mostly using about 100-150 MB. This is for vanilla Minecraft running in 32 bit Java with no mods installed and using the default texture pack. Any memory above this will be used for garbage collector buffer and may cause memory to be swapped to disk and generate a lot of lag.
Starting Minecraft with less memory greatly reduces the chance of swapping to disk, especially for computers with less than 3 GB memory."
Hope this helps.
I am the biggest lurker you've (n)ever seen.