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
the amount of memory consumed per user big123456 UNIX for Advanced & Expert Users 1 11-24-2006 02:22 AM
amount of memory in my server new2ss UNIX for Dummies Questions & Answers 2 11-06-2006 07:28 AM
Shared memory shortage but lots of unused memory cjcamaro UNIX for Advanced & Expert Users 1 10-13-2004 02:10 PM
Amount of RAM (Memory) samudimu UNIX for Dummies Questions & Answers 4 07-29-2003 10:40 AM
How to get amount of memory installed. elgholm UNIX for Dummies Questions & Answers 4 08-24-2001 04:04 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 02-14-2008
Registered User
 

Join Date: Feb 2005
Posts: 4
Question shmat() Failure While Using a Large Amount of Shared Memory

Hi,

I'm developing a data processing pipeline with multiple stages, with data being moved between the stages using shared memory segments. The size of the data is typically of the order of hundreds of megabytes, and there are typically a few tens of main shared memory segments each of size around 10MB, and a few other shared memory segments of total size less than 1MB.

The problem I'm facing is that after around 600MB has been created in various shared memory segments, further shmat() fails, throwing the error 'Cannot allocate memory'. I tried various combinations of shared memory sizes, and the results are tabulated below.

Code:
----------------------------------------------------------
Size of individual segment | Total allocated shared memory
----------------------------------------------------------
      10485760 (10MB)      |      639635428 (~ 610MB)
      15728640 (15MB)      |      644877668 (~ 615MB)
      31457280 (30MB)      |      660605700 (~ 630MB)
----------------------------------------------------------
The system limits regarding shared memory as defined in the directory /proc/sys/kernel are as follows:

Code:
shmall = 2097152
shmmax = 33554432
shmmni = 4096
The contents of /proc/swaps is as follows:

Code:
Filename      Type            Size    Used    Priority
/dev/sda7     partition       3903752 34792   -1
This program used to work on a different PC which I was using earlier, but not on the current one. I'm running Kubuntu 7.10 on an Intel Core 2 Duo machine with 4GB of RAM.

Can anyone help me figure out where the problem is? Appreciate any help!

Thanks,

Jayanth

Last edited by theicarusagenda; 02-18-2008 at 04:03 AM.
Reply With Quote
Forum Sponsor
  #2  
Old 02-21-2008
Registered User
 

Join Date: May 2006
Posts: 101
1, shmat() is deprecated SYSV legacy use shm_open()

2. shmat() is done by the kernel itself fill a bugreport for the linux kernel mailing list if you thing it is not your program that causes the problem
Reply With Quote
  #3  
Old 02-25-2008
Registered User
 

Join Date: Feb 2005
Posts: 4
Thanks for the suggestions, grumpf!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:34 AM.


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 Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0