The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mac OS, Linux May Share a Windows Flaw - PC World iBot UNIX and Linux RSS News 0 10-13-2007 10:50 AM
how i can share the file between unix or linux in windows ?? msn22 Linux 4 12-07-2006 11:13 AM
Mount Linux share onto Sco 5.0.6 sall UNIX for Advanced & Expert Users 1 09-10-2006 02:32 PM
Red Hat Linux & Desktop Market Share Jawwad Linux 11 06-15-2006 04:38 PM
Mount W2K share on Redhat Linux Spetnik Linux 3 12-16-2003 03:13 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-31-2008
Registered User
 

Join Date: Nov 2006
Posts: 168
share memory on linux

how to list the orphaned shared memory?
how to kill them so that shared mem is free again.

thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-31-2008
Yogesh Sawant's Avatar
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 767
Use the ipcrm -m command to free the orphaned shared memory, once you identify it
Reply With Quote
  #3 (permalink)  
Old 03-31-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,854
/proc/<process id>/maps or /proc/<process id>/smaps

try man 5 proc to see which one your system has and how to use it, to see if it meets your needs. I'm personally not too sure about finding orphaned memory.
Why do you think there is a problem? Are you sure it isn't some kind of memory leak?
Reply With Quote
  #4 (permalink)  
Old 03-31-2008
Registered User
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 250
ipcs shows your sysv ipc id's, etc..Otherwise as Jim noted.

If I understand correctly: We all have this problem when testing code sometimes.
Without a signal handler that cleans up the allocated shared memory segment
on a user interrupt you are stuck with manually removing the segment.

This is especially painful when the id is hardcoded and IPC_EXCL is specified or when you run into a sysv ipc limit maximum.
Reply With Quote
  #5 (permalink)  
Old 04-01-2008
Registered User
 

Join Date: Nov 2006
Posts: 168
thanks for the replies.

ipcrm -m must be followed by shmid. how to get this id?

Also, I tried to set "kernel.shmseg" to 10 in /etc/sysctl.conf:

/sbin/sysctl -p
...
error: "kernel.shmseg" is an unknown key

Any idea how to set the kernel.shmseg?

I am using RHEL 4.
thanks
Reply With Quote
  #6 (permalink)  
Old 04-01-2008
Registered User
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 250
Umm..by ipcs output?

A typical listing looks like:
Code:
0x00000000 2112782337 username  666        4          0
Identification shouldn't be difficult. If it is (and I'm sorry if I make people mad) you shouldn't be using sys v ipc.
Reply With Quote
  #7 (permalink)  
Old 04-01-2008
Registered User
 

Join Date: Nov 2006
Posts: 168
thanks.

do you know what is the equivalent of kernel.shmseg for Redhat Linux Enterprise 4?
tx
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
ipcrm, linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0