As I suggested before, "ipcs -m" will display the shared-memory segments currently in use.
Perhaps this will help you debug your application.
Still not sure what you mean by "used or left out".
The OS doesn't know how much of a shared-memory segment has been "used". Your app makes a call, say, asking for a shared-memory segment of 10,000 bytes. At some point you tell the OS you are done, and it takes the memory back. But the OS has no idea if you've stuffed 1 byte, 5000, or 10,000 into the memory.
Should you attempt to write outside of an allocated memory segment (e.g. in the above example, to byte 10,001) you will get a segmentation violation.
You *are* giving the shared memory segments back eventually, right?
It's unclear to me if you've written this application yourself, or if it is a software package you've obtained. If it's a software package that you didn't write yourself, you're probably best off seeking help from any support resources that application has. Sounds more to me like a buggy program than an actual OS problem.
Now, there are some limits placed on shared memory segment size, number of shared memory segments, etc. This varies from system to system. There are a number of kernel variables that you can view to determine the limits on your system. You can "cat" the variable numbers in /proc/sys/kernel. For example, to view the maximum size of a shared-memory segment:
cat /proc/sys/kernel/shmmax
Here are the values on my Fedora Core 6 system:
shmmax - max size of a shared-memory segment: 33554432
shmall - total shared memory avail: 2097152
shmseg - max # of shared memory segs per process: (doesn't exist in FC6)
shmmni - max # of shared memory segs system-wide: 4096
Note my previous caveat about interpreting "available memory" statistics in Linux. They aren't really meaningful, as you need to add the memory being used for disk caching and tmpfs to any "available" feature.
I'm thinking your app may be running afoul of the max number of shared memory segments system-wide - especially if it isn't giving them back when it is done!