[Qt-interest] QSharedMemory limits on Mac OS X
Frank Mertens
frank at cyblogic.de
Wed Apr 14 14:34:21 CEST 2010
Kustaa Nyholm wrote:
> A quick web search indicates the shared memory on Mac OS X is
> limited to 4 MB by default and it cannot be changed on the
> fly and changing it requires quite a lot of privileges.
>
> So does QSharedMemory use this shared memory mechanism and
> is it thus limited system wide to 4 MB?
>
> 4 MB is not a lot if you need to share something like
> frame buffers...
>
> This page:
>
> http://www.ssec.wisc.edu/mcidas/doc/users_guide/2009.2/SharedMemory.html
>
> implies that Linux and Solaris too have limitations that
> are easy to run into.
>
>
Have you tried mmap() directly? It is not affected by the kern.sysv.* limits.
SysV IPC is basicly there for backwards compatibility, nobody should use it anymore.
Hmmm...
qt-4.6/src/corelib$ grep -rn shmat *
kernel/qsharedmemory_unix.cpp:233: memory = shmat(id, 0, (mode == QSharedMemory::ReadOnly ? SHM_RDONLY : 0));
kernel/qsharedmemory_unix.cpp:236: setErrorString(QLatin1String("QSharedMemory::attach (shmat)"));
... seems Qt is still using it, though.
More information about the Qt-interest-old
mailing list