I have a machine with fairly much memory 16GB and I get
shmget failed: error 28 (No space left on device). It seems
that I may be out of shared memory, how do I increase that?

$ free
             total       used       free     shared    buffers     cached
Mem:      14976000   14945552      30448          0     146560    1298908
-/+ buffers/cache:   13500084    1475916
Swap:     18448376    6730856   11717520

Kind regards,
Christian