But its limited to the value of SHMMAX with which the kernel was compiled. SHMMAX is defined in shmparam.h.
However, if I read the docs correct, this value is the per-segment limit, not the grand total. The number of segments is capped by SHMALL. So if your DB can be taught to allocate more than one segment you can avoid recompiling.