As the limit of 32bit systems is 4GB of RAM and the system needs memory for Swap, kernel among others the practical limit is around 1.4GB to 1.6 GB (source).
Relationship between Permsize and Heapsize:
traditional heap = objects
perm heap = definitions of classes
That is, the perm heap is an additional space separated from the conventional heap space (for objects). Soon the larger the space you set for it the more space will occupy the system and this will limit as much as your system will allow for the conventional heap.
Therefore the Perm heap is not included in the heap (Xmx) but it can limit it by consuming an additional space of the system that in a 32bit system will be much more limited than in a 64bit.
Exemplifying: 512Mb + 1024Mb = 1.5Gb
(total space your system allowed for the JVM) which as you can see is in the range described at the beginning of this response.
See the official documentation on the oracle.
The table below shows how to define these options in the JVM
+-----------------+----------------------------------------+---------------------+
| Opção da JVM | Significado | Exemplo |
| -Xms | heap size inicial da JVM | -Xms3072M |
| -Xmx | tamanho máximo do heap da JVM | -Xmx16G |
| -XX:PermSize | tamanho inicial do espaço permanente | -XX:PermSize=128k |
| -XX:MaxPermSize | tamannho máximo do espaço permanente | -XX:MaxPermSize=256m|
+-----------------+----------------------------------------+---------------------+
I believe it is useful to have this table in an answer about Ssosince I suspect that not everyone knows how to set up such elements