vijesh has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I use following program to get a shared mem location. How do I know how much size of shared mem is getting allocated? how possible is to release that mem size once I am done. -Thanks, Vijesh

my $id = shmget($key, $size, &IPC_CREAT | 0777 );

Replies are listed 'Best First'.
Re: Mem shize for a shared mem (shmget)
by Anonymous Monk on Dec 11, 2013 at 02:55 UTC
    Hmm, it either allocates how much you ask for, or it fails? What does man shmget say?

      it just returns the shared mem location. Does not say anything about the size. please find some perld

      DB<1> n main::(shm.pl:10): my $id = shmget( $key, $size, &IPC_CREAT | 077 +7 ); DB<1> x shmget( $key, $size, &IPC_CREAT | 0777 ); 0 9142327 DB<2> p $key 90 DB<4> p $size 100 DB<5>
        hello Monks, any help will be appreciated. -Thanks