I suggest adding this to Extension:SyntaxHighlight#Syntax highlighting error category:
"The category may also be added if there are more than 1000 lines or more than 100 kB text.[1]"
It was reported at w:Wikipedia:Village pump (technical)#Syntax highlighting. I have not actually been able to produce the error with 5000 lines at enwiki but it does happen above 100 kB.