Max size for PlayerPrefs.GetString or SetString ?

Is there a maximum length for the String you can store to PlayerPrefs?

So, I actually went and tested this. I found that in the editor, and in Windows builds, this breaks at a 1MB string. Oddly enough, on Android, it juts goes up till it crashes, but then every time I try to run it again, it crashes immediately.

using UnityEngine;
using System.Collections;

public class PPDump : MonoBehaviour {

public int length;
public string original = "x";
string str;
public int count;
public bool run;

void Start() {
	count = 0;
	length = 0;
	str = original;
}
void OnGUI() {
	GUILayout.Label("Length: " + length);
}
void Update () {
	if(run) {
		str += str;
		length += str.Length;
		PlayerPrefs.SetString("save " + count, str);
		if(PlayerPrefs.GetString("save " + count) != str) {
			Debug.Log("Broken");
			run = false;
		}
		count++;
	}
}

}

The size limit will depend on the platform. For example, on Windows standalone builds, PlayerPrefs uses the registry to store the values. According to Microsoft, the length limit of a registry value is 1MB. Registry Element Size Limits

So there is no fixed size limit set by Unity. You’d have to do testing to determine what the limit is on each platform.

FYI, Windows also has another little quirk when storing data in the registry. If your value name length (what Unity calls a key) is 255 characters or longer, the value will not show up in Regedit, though Unity will still load the value fine. Unity appends a 12 character suffix to whatever you name your key, so the max chars you can use without making the value invisible to Regedit is 243 characters.

I don't think there is a maximum size per element but there is a maximum size for the total data (the smallest is webplayer which is 1MB).

http://answers.unity3d.com/questions/151948/how-many-variables-can-i-store-using-playerprefs.html