LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-08-2006, 11:23 AM   #1
shashwat.gupta
LQ Newbie
 
Registered: May 2006
Posts: 18

Rep: Reputation: 0
ared meprobelm im getting shared memory higher then 672 MB


Hi there,

I am using Redhat Enterprise Linux 3. I am using it on 512 MB RAM . For some application I want shared memory up to 2.5 GB. I was just trying to get shared memory through simple program that uses shmget system call. for memory allocation. I changed the entry of shmmax with command echo "1073741824" >/proc/sys/kernel/shmmax

Then try to execute a program which allocate shared memory
sharedmemory.c as follows --
#include <sys/types.h>
#include <sys/ipc.h>

#include <sys/shm.h>
#include <errno.h>
#include <stdio.h>


#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>

int main(){


key_t key = 1311;

int m_shmid = shmget(key,1048576*1024,IPC_CREAT|0666);
/*trying to allocate memory size of 1GB */
printf("m_shmid value is %d", m_shmid);
}


/*some header file are extra pleasse do not mind*/

The shmid value comes out to be -1 surprisingly method works perfectly when I try to allocate the memory up to 688128*1024 bytes (That is 672 MB) I donot reason please tell me any thing I need to do make it work

I am executing all commands on root permission
Any help will be highly appriciated ... Thanks in advance
 
Old 05-08-2006, 01:03 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Duplicate thread

Duplicate thread:
http://www.linuxquestions.org/questi...d.php?t=442816
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using shared memory clunix Programming 2 04-08-2006 12:13 PM
is shared memory expandable in memory size? Thinking Programming 4 08-16-2005 09:57 AM
memory managment problem; higher dimensional array doesn't delete qanopus Programming 5 06-15-2005 04:18 PM
c + shared memory dilberim82 Programming 3 03-07-2005 07:49 PM
About Shared Memory...? aegis_shiva Programming 1 08-25-2004 05:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration