public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* howto see shmem
@ 2001-10-24 21:40 Martín Marqués
  2001-10-24 23:17 ` Marc Brekoo
  2001-10-25 13:34 ` Christoph Rohland
  0 siblings, 2 replies; 7+ messages in thread
From: Martín Marqués @ 2001-10-24 21:40 UTC (permalink / raw)
  To: linux-kernel

I have found out that /proc/meminfo doesn't have (at least that's my first 
thought) info about shared memory (it shows 0, even in heavy duty servers). 
ipcs also shows nothing, so how can I see the amount of shared memory being 
used?
Th mounted /dev/shmem device also shows 0 kb used (just in case).

Saludos... :-)

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués                  |        mmarques@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: howto see shmem
  2001-10-24 21:40 howto see shmem Martín Marqués
@ 2001-10-24 23:17 ` Marc Brekoo
  2001-10-24 23:27   ` Martín Marqués
  2001-10-25 13:34 ` Christoph Rohland
  1 sibling, 1 reply; 7+ messages in thread
From: Marc Brekoo @ 2001-10-24 23:17 UTC (permalink / raw)
  To: Martín Marqués; +Cc: linux-kernel

Hi,

>I have found out that /proc/meminfo doesn't have (at least that's my first
>thought) info about shared memory (it shows 0, even in heavy duty servers).
>ipcs also shows nothing, so how can I see the amount of shared memory being
>used?
>Th mounted /dev/shmem device also shows 0 kb used (just in case).

AFAIK you can't. Calculating how much shared mem is used in 2.4.x is just
too hard...

Greets,
Marc.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: howto see shmem
  2001-10-24 23:17 ` Marc Brekoo
@ 2001-10-24 23:27   ` Martín Marqués
  2001-10-24 23:37     ` Robert Love
  0 siblings, 1 reply; 7+ messages in thread
From: Martín Marqués @ 2001-10-24 23:27 UTC (permalink / raw)
  To: Marc Brekoo; +Cc: linux-kernel

On Mié 24 Oct 2001 20:17, Marc Brekoo wrote:
> Hi,
>
> >I have found out that /proc/meminfo doesn't have (at least that's my first
> >thought) info about shared memory (it shows 0, even in heavy duty
> > servers). ipcs also shows nothing, so how can I see the amount of shared
> > memory being used?
> >Th mounted /dev/shmem device also shows 0 kb used (just in case).
>
> AFAIK you can't. Calculating how much shared mem is used in 2.4.x is just
> too hard...

And this:

# ipcs
 
------ Shared Memory Segments --------
key       shmid     owner     perms     bytes     nattch    status
0x00000000 65536     nobody    600       46084     11        dest
 
------ Semaphore Arrays --------
key       semid     owner     perms     nsems     status
0x00000000 393216    nobody    600       1
 
------ Message Queues --------
key       msqid     owner     perms     used-bytes  messages
 
#

I can see 46084 bytes in shared memory used by the apache.
Am I wrong?

Saludos... :-)

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués                  |        mmarques@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: howto see shmem
  2001-10-24 23:27   ` Martín Marqués
@ 2001-10-24 23:37     ` Robert Love
  2001-10-24 23:39       ` Martín Marqués
  2001-10-24 23:48       ` Mike Fedyk
  0 siblings, 2 replies; 7+ messages in thread
From: Robert Love @ 2001-10-24 23:37 UTC (permalink / raw)
  To: Martín Marqués; +Cc: Marc Brekoo, linux-kernel

On Wed, 2001-10-24 at 19:27, Martín Marqués wrote:
> [...]
> ------ Shared Memory Segments --------
> key       shmid     owner     perms     bytes     nattch    status
> 0x00000000 65536     nobody    600       46084     11        dest
> [...]
> I can see 46084 bytes in shared memory used by the apache.
> Am I wrong?

Nope.  Applications know how much the are sharing because they can
easily see what region of memory is shared/mapped into their's.

The reason the kernel can't figure out the net shared memory is because
there is no simple way -- it has to add up the shared regions of all
applications, counting each shared segment only once.  Too much work.

	Robert Love


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: howto see shmem
  2001-10-24 23:37     ` Robert Love
@ 2001-10-24 23:39       ` Martín Marqués
  2001-10-24 23:48       ` Mike Fedyk
  1 sibling, 0 replies; 7+ messages in thread
From: Martín Marqués @ 2001-10-24 23:39 UTC (permalink / raw)
  To: Robert Love; +Cc: Marc Brekoo, linux-kernel

On Mié 24 Oct 2001 20:37, Robert Love wrote:
> On Wed, 2001-10-24 at 19:27, Martín Marqués wrote:
> > [...]
> > ------ Shared Memory Segments --------
> > key       shmid     owner     perms     bytes     nattch    status
> > 0x00000000 65536     nobody    600       46084     11        dest
> > [...]
> > I can see 46084 bytes in shared memory used by the apache.
> > Am I wrong?
>
> Nope.  Applications know how much the are sharing because they can
> easily see what region of memory is shared/mapped into their's.
>
> The reason the kernel can't figure out the net shared memory is because
> there is no simple way -- it has to add up the shared regions of all
> applications, counting each shared segment only once.  Too much work.

Yes, I guess you are right. I just checked on and old RH server with a 2.2.x 
kernel, and the sum of the shared memory of each application doesn't give me 
the amount of shared memory that free gives me.

Thanks to all!

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués                  |        mmarques@unl.edu.ar
Programador, Administrador, DBA |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: howto see shmem
  2001-10-24 23:37     ` Robert Love
  2001-10-24 23:39       ` Martín Marqués
@ 2001-10-24 23:48       ` Mike Fedyk
  1 sibling, 0 replies; 7+ messages in thread
From: Mike Fedyk @ 2001-10-24 23:48 UTC (permalink / raw)
  To: Robert Love; +Cc: Mart?n Marqu?s, Marc Brekoo, linux-kernel

On Wed, Oct 24, 2001 at 07:37:26PM -0400, Robert Love wrote:
> On Wed, 2001-10-24 at 19:27, Mart?n Marqu?s wrote:
> > [...]
> > ------ Shared Memory Segments --------
> > key       shmid     owner     perms     bytes     nattch    status
> > 0x00000000 65536     nobody    600       46084     11        dest
> > [...]
> > I can see 46084 bytes in shared memory used by the apache.
> > Am I wrong?
> 
> Nope.  Applications know how much the are sharing because they can
> easily see what region of memory is shared/mapped into their's.
> 
> The reason the kernel can't figure out the net shared memory is because
> there is no simple way -- it has to add up the shared regions of all
> applications, counting each shared segment only once.  Too much work.
> 

Actually, if it's done in the COW code, you could quite possibly get most of
it right there...

Does anyone know of something that can make use of the shmem accting?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: howto see shmem
  2001-10-24 21:40 howto see shmem Martín Marqués
  2001-10-24 23:17 ` Marc Brekoo
@ 2001-10-25 13:34 ` Christoph Rohland
  1 sibling, 0 replies; 7+ messages in thread
From: Christoph Rohland @ 2001-10-25 13:34 UTC (permalink / raw)
  To: Martín Marqués; +Cc: linux-kernel

Hi Martín,

On Wed, 24 Oct 2001, Martín Marqués wrote:
> I have found out that /proc/meminfo doesn't have (at least that's my
> first thought) info about shared memory (it shows 0, even in heavy
> duty servers). 

/proc/meminfo did show the number of shared pages in the whole system
independent of SYSV shared mem.

In the -ac series it shows all shared anonymous pages
(i.e. tmpfs, shared mmap and SYSV shm pages)

> ipcs also shows nothing, so how can I see the amount
> of shared memory being used?  

linux:~ # ipcs -mu

------ Shared Memory Status --------
segments allocated 3
pages allocated 256
pages resident  12
pages swapped   87
Swap performance: 0 attempts     0 successes

It shows it.

> Th mounted /dev/shmem device also shows 0 kb used (just in case).

That would only show the posix shared memory segments in this
instance.

Greetings
		Christoph



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-10-25 13:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-24 21:40 howto see shmem Martín Marqués
2001-10-24 23:17 ` Marc Brekoo
2001-10-24 23:27   ` Martín Marqués
2001-10-24 23:37     ` Robert Love
2001-10-24 23:39       ` Martín Marqués
2001-10-24 23:48       ` Mike Fedyk
2001-10-25 13:34 ` Christoph Rohland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox