If you are using the Security Token Service (STS), set the MaxPermSize JVM option to a minimum value of 128 MB. For example:
-XX:MaxPermSize=128M