Setting shared_buffers in postgresql.conf does not seem to take effect
The canonical unit for shared_buffers is pages of 8kB, so the actual memory allocated in bytes is:

524288 * 8192 = 4294967296 or 4096*1024*1024 as requested.

You can also check the size of the segment of memory with ipcs -m