Dev's Weblog

We have moved to sysdbaonline.com

Trouble shoot Out Of Memory Error for Oracle

 

Please compile the following program and run it to check whether OS is releasing any shared memory for application or not.

=================================================================

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <errno.h>
int main()
{
int shmid,size;
void *buf=0;
extern int errno;
/* Change it to size of shared memory you want (in MB) */
size = 200;
if ((shmid=shmget(rand()%10,1048576*size,0666|IPC_CREAT))==-1)
{
printf(“Error during shmget, OS Error %d\n”,errno);
exit(1);
}
if (((void *)shmat(shmid,(void *)0,0666))==0)
{
printf(“Error during shmat, OS Error %d\n”,errno);
exit(1);
}
shmctl(shmid,IPC_RMID,buf);
printf(“Succesfully got, attached a %dM shared memory segment\n”,size);
}

=================================================================

$cc -o <output filename>  <program.c>

January 9, 2009 - Posted by sdevang | Standalone Oracle Database | | No Comments Yet

No comments yet.

Leave a comment