[MC-11571] Huge lighting updates lag the game. Created: 11/Mar/13  Updated: 06/May/19  Resolved: 23/Oct/18

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.7, Snapshot 13w10b, Minecraft 1.5, Minecraft 1.8, Minecraft 1.8.1-pre2, Minecraft 1.8.1, Minecraft 1.8.2-pre4, Minecraft 1.8.8, Minecraft 15w44b, Minecraft 15w46a, Minecraft 1.8.9, Minecraft 15w51b, Minecraft 1.9.2, Minecraft 1.9.4, Minecraft 1.10.2, Minecraft 1.11.2, Minecraft 1.12 Pre-Release 6, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2, Minecraft 18w05a, Minecraft 18w09a, Minecraft 1.13, Minecraft 18w30b, Minecraft 1.13.1, Minecraft 1.13.2-pre1, Minecraft 1.13.2-pre2, Minecraft 1.13.2
Fix Version/s: Minecraft 18w43a

Type: Bug
Reporter: Oval Assignee: [Mojang] Georgii Gavrichev
Resolution: Fixed Votes: 48
Labels: fps, freeze, lag, light, lighting, lockup

Attachments: PNG File 2018-08-29_04.15.51.png     PNG File 2018-08-29_04.18.00.png     Zip Archive Debug-test-15w51b.zip     Zip Archive LightBug.zip     File MC-136549.mp4     Text File crash-2013-03-11_17.26.29-client.txt     Text File decoded.log     PNG File screenshot-1.png    
Issue Links:
Duplicate
is duplicated by MC-70253 Big lag spike when placing blocks in ... Resolved
is duplicated by MC-72310 Huge momentary block lag when placing... Resolved
is duplicated by MC-74637 Lag spike created when brakeing/placi... Resolved
is duplicated by MC-87947 Placing blocks high in the air causes... Resolved
is duplicated by MC-92035 When breaking or replacing a hole on ... Resolved
is duplicated by MC-92686 Extreme sudden fps drop and lag when ... Resolved
is duplicated by MC-95513 Using /fill command for large range c... Resolved
is duplicated by MC-101850 Massive lag with light updates Resolved
is duplicated by MC-102346 Minecraft freezes for a second when b... Resolved
is duplicated by MC-104458 Lag when breaking block over the void Resolved
is duplicated by MC-104812 /fill on top of world Resolved
is duplicated by MC-105156 Shadows cause lag in the overworld! Resolved
is duplicated by MC-105353 Lag, when you are placing a Block, wh... Resolved
is duplicated by MC-118032 Light freezes mc Resolved
is duplicated by MC-125149 Slabs at y 256 causing major lag Resolved
is duplicated by MC-126740 Huge block lag Resolved
is duplicated by MC-132376 Game Freezes When Block is Placed Resolved
is duplicated by MC-136549 Skylight / light updates FPS lag Resolved
CHK:
Confirmation Status: Confirmed
Game Mode: Survival

 Description   

 The bug

This bug causes alot of light updates, dropping your FPS to 0 and most likely crashing your game.

This has been used for around a year now on several servers, this causes players to crash their game.

How to reproduce

  1. Create a new world (superflat, cheats on)
  2. Execute command: /fill ~20 ~200 ~-20 ~-20 ~200 ~20 stone
  3. Teleport yourself up to the platform. (/tp @a ~ ~205 ~)
  4. Place 2 observers facing into each other, make a hole 1 block away from the observer. (See screenshot for setup. the observers is to make a repeating redstone clock)
  5. Just place the piston so it pulls the block over the hole.
  6. Prepare yourself to see your FPS drop to 0.

Code analysis

The following is based on a decompiled version of Minecraft 1.12 using MCP940.

In the method net.minecraft.world.chunk.setBlockState() you have this~~

if (j >= i1)
{
this.relightBlock(i, j + 1, k);
}

which relight blocks, but this is causing the massive FPS drops. What this does is, if j (posY) is bigger then i1, it will relight the block on the X, Y + 1, Z the player is.

If you remove the '+ 1' this issue will be fixed. idk why though.

if (j >= i1) 
{ 
this.relightBlock(i, j, k); 
}

----------------------------------------------------------------------

When making a Creative world with bedrock at the bottom, air for most, and bedrock at the top, when you break the bedrock the game lags for about 7 seconds.

Example superflat preset: 3;minecraft:bedrock,250*minecraft:air,minecraft:bedrock;1;

I made a program that will take the "Something's taking too long!" messages and put it in a list. In the attached list, you can see that root.tick.level.connection is taking a VERY long time.

I hope this gets fixed soon, because it can be a huge exploit on servers.

^ original report

 



 Comments   
Comment by RedCMD [ 11/Sep/18 ]

If the stone platform is at y=200
and is 57 or more blocks across (square)
and all blocks under the platform is air

X=29 (Distance of Light spread from center) Y=200 (Height of platform)
Breaking the block in the middle will produce .5(X^2+1)Y+1 = 84200 (84k) skylight updates

X=15 (Sky Light level) Y=200 (Height of platform)
Replacing the block will produce Y((X^2+2)X^2/3)+X = 3405015 (3405k,  3.4million) skylight updates

 

Oh and redstone dust does NOT produce light updates (they cause block updates)
Repeaters used to in 1.5.2 but that got removed due to lag

Comment by Oval [ 11/Sep/18 ]

RedCMD It literally doesn't matter. you still drop frames on Y: 200

Comment by RedCMD [ 11/Sep/18 ]

change "fill ~20 ~200 ~-20 ~-20 ~200 ~20" to "/fill ~20 240 ~-20 ~-20 240 ~20"

and "/tp @a ~ ~205 ~" to "/tp @p ~ 250 ~"

Comment by Saisho Bready [ 28/Jul/18 ]

confirmed for breaking last bedrock level on 18w30b

Comment by DecafDawren [ 13/Feb/18 ]

This also occurs on Java 8 and on Linux.

Comment by LuxiKeks [ 04/Feb/18 ]

This is affecting every 1.13 snapshot as well.

Comment by Daniil Aripov [ 19/Sep/17 ]

From all comments I noticed this is both client-side and server-side issue. When removing light source at underground, it would lag more than if you remove it at surface during daytime. More checks needed about light updates client-side and server-side.

Comment by McModknower [ 13/Sep/17 ]

Still in 1.12.2 Pre-release. Please fix this Mojang.
If you put a Piston on the right Position with a clock you can effectively crash every client in the sourrounding.

Comment by Midnaait [ 31/May/17 ]

Still happening in the 1.12 pre-release 6

Comment by Sven [ 19/Apr/16 ]

Well you can add 1.9.2 to the list and I don't really think this is a creative only issue either... I noticed lagspikes when building the roof and the last block just kills it completely (client and server both on quite some hardware)...

https://www.youtube.com/watch?v=UdZ-mKk5i1Q

Comment by Alun Blue [ 04/Jan/16 ]

The way I came across this bug was when changing a large 1 block tall plane of grass blocks. Since there was no light underneath the platform, it would lag when removing the light from underneath the platform when the hole creating the light (from the sky) was filled in. This only happened when the light went away.

For me it specifically caused a 2 - 3 second lag in root.tick.keyboard

Comment by PlNG [ 19/Dec/15 ]

"Simple" build that confirms the issue.
Punch obsidian to observe normal behavior.
Toggle lever (This slides a block under the chest to expose darkness)
Punch obsidian to observe the lag.

These spike to 50% for me:
root.gamerenderer.level.terrain_setup.culling.build_near 1.8.9
root.tick.level.entities.blockEntities.aqr.checkedPosition 15w51b

Comment by user-f2760 (Inactive) [ 03/Nov/15 ]

confirmed for 15w44b

Comment by [Mod] Sonicwave [ 18/Jan/15 ]

Confirmed in 1.8.2-pre4. The lag seems much more extreme when blocking the light than when removing the block.

Comment by Bentroen [ 16/Dec/14 ]

Confirmed for 1.8.1. As a prove that this is related to lighting, if you cover yourself in a 1x2x1 hole with no light (or any room with a low light level), open a hole to the void, and then cover it, it will not lag, because of the low light level. But if you don't block the light, it will lag a lot.

Comment by KingSupernova [ 08/Dec/14 ]

I noticed that this only happens with opaque blocks, implying that it is a lighting issue. Also, if the hole you are filling in is filled with water, it won't lag. By the way, a much easier way to test this is to just make a one layer thick superflat world.

Comment by [Mod] Sonicwave [ 21/Oct/14 ]

Confirmed for 1.8.1-pre2.

Comment by [Mod] Sonicwave [ 10/Oct/14 ]

Are the affected versions still getting updated? (MC-72310 is for 1.8.)

Comment by ggxl [ 28/Jun/14 ]

I've heard that this can be problematic for complicated, exposed redstone mechanisms (because lighting updates need to occur whenever dust and such turns on/off).

Comment by StrangeOne101 [ 21/Apr/14 ]

I can reproduce this in the latest 14w11b snapshot. Causes lag that lasts just under half a second.

Way to reproduce:

1. Create a new world and dig down with a 1x1 tunnel to bedrock level.
2. Use the fill command to dig out a 40x10x40 area around you.
3. Remove all light in the area.
4. While standing in the empty area, place 1 block in the tunnel you dug to block the light from the sky. Can also be seen when the block is removed.

Comment by fienxjox [ 22/Mar/14 ]

Cannot reproduce in 14w11b. World preset used:

2;1x7,10x0,1x3;2;

The used:

/fill ~ ~ ~ ~-40 ~-1 ~40 minecraft:air

to cause as many lighting updates as possible. Smooth lighting at maximum, render distance 16.

Comment by Kumasasa [ 11/Mar/13 ]

Confirmed.
Getting

2013-03-11 22:57:56 [SERVER] [WARNING] Can't keep up! Did the system time change, or is the server overloaded?
2013-03-11 22:58:12 [SERVER] [WARNING] Can't keep up! Did the system time change, or is the server overloaded?
2013-03-11 22:59:20 [SERVER] [WARNING] Can't keep up! Did the system time change, or is the server overloaded?
2013-03-11 23:00:06 [SERVER] [WARNING] Can't keep up! Did the system time change, or is the server overloaded?
2013-03-11 23:00:11 [SERVER] [INFO] Saving and pausing game...

in the console.

Comment by Dwayne Slater [ 11/Mar/13 ]

I don't think I broke the redstone, so it may still be running.

Comment by Kumasasa [ 11/Mar/13 ]

Yes, please upload the world.
The crash report isn't helpful.

Comment by Dwayne Slater [ 11/Mar/13 ]

In vanilla, I made a piston that would extend and rectract on an uncovered block. The lag was horrendous. I got down to 0 fps before the F3+C worked. I can upload the world if you want me to.

Comment by Kumasasa [ 11/Mar/13 ]

Please force a crash by pressing F3 + C for 10 seconds while ingame and attach the crash report here.

Comment by Dwayne Slater [ 11/Mar/13 ]

Also, root.tick.keyboard lags when you break the block.

Generated at Sun Jan 12 12:28:05 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.