Error: Optimized GUI Block text buffer

Hello! I get the following error message which I can't find any information about:

Optimized GUI Block text buffer too large. Not appending further text. UnityEngine.GUIStyle:Internal_Draw(IntPtr, Rect, String, Texture, Boolean, Boolean, Boolean, Boolean) UnityEngine.GUIStyle:Internal_Draw(IntPtr, Rect, String, Texture, Boolean, Boolean, Boolean, Boolean) UnityEngine.GUIStyle:Draw(Rect, GUIContent, Int32, Boolean) UnityEditor.EditorGUI:DoTextField(RecycledTextEditor, Int32, Rect, String, GUIStyle, String, Boolean&, Boolean, Boolean, Boolean) UnityEditor.EditorGUI:TextField(Rect, GUIContent, String, GUIStyle) UnityEditor.EditorGUI:TextField(Rect, GUIContent, String) UnityEditor.EditorGUI:PropertyField(Rect, SerializedProperty) UnityEditor.Editor:OptimizedInspectorGUIImplementation(Rect) UnityEditor.GenericInspector:OnOptimizedInspectorGUI(Rect) UnityEditor.InspectorWindow:OnGUI() System.Reflection.MonoMethod:InternalInvoke(Object, Object[]) System.Reflection.MonoMethod:InternalInvoke(Object, Object[]) System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) System.Reflection.MethodBase:Invoke(Object, Object[]) UnityEditor.HostView:Invoke(String) UnityEditor.DockArea:OnGUI()

[....\Editor\Src\OptimizedGUIBlock.cpp line 107]

Could anyone shed any light on this issue for me? Did you have any experiences with this error message before? Any information on possible causes would be appreciated.

Thanks Sebas

I had a similar error message recently:

Optimized GUI Block Text buffer too large. Not appending further text. UnityEditor.DockArea:OnGUI()

I realised that I had some string arrays (huge) for file handling, visible in the Inspector - once I made them private (i.e. no longer visible via the inspector) the error disappeared!


var fileContents : String;

var lines : String[];

changed to:

private var fileContents : String;

private var lines : String[];

That is a very large block of error message you got there...

At first glance I would say that you are trying to load too much text into a text field in the GUI or perhaps you should set a buffer size that accommodate your needs or consider emptying the buffer when it reaches a certain size by writing the data to the file in smaller intervals instead of at the end of the scene. It is not that apparent to me because I am not fully aware how you do it.

Consider taking it to the forum and throw some example files/project in the pot.


I found a work around. Break your array into to different arrays. You can even have your second array start where you last one ended.

		if(Assgn >=34){
			InterpretationText.text = array1[Assgn];
			} else {
			   InterpretationText.text = array2[Assgn];

I found a work around by breaking the array in two. You can even start the second where the first array ended.

		if(Assgn >=34){
			InterpretationText.text = array2[Assgn];
			} else {

			InterpretationText.text = array[Assgn];