Re: PostgreSQL on FreeBSD 7.0 amd64 with more than 2GB shared memory

2008-12-11 Thread Ivan Voras
Hell, Robert wrote:
 I just found a bug report for that issue:
 http://www.freebsd.org/cgi/query-pr.cgi?pr=121423cat=

Try asking on current@ - I think there were some patches available some
time ago.


 -Original Message-
 From: Wojciech Puchar [mailto:[EMAIL PROTECTED] 
 Sent: Mittwoch, 10. Dezember 2008 18:30
 To: Hell, Robert
 Cc: freebsd-questions@freebsd.org
 Subject: Re: PostgreSQL on FreeBSD 7.0 amd64 with more than 2GB shared
 memory
 
 fails again with ENOMEM.
 Is there any easy way to use a shared memory segment which is larger
 than 2GB?
 
 getting two smaller ? :)
 
 no idea - maybe it's bug of SHM. as you already checked it please do 
 sent-pr
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
 



signature.asc
Description: OpenPGP digital signature


PostgreSQL on FreeBSD 7.0 amd64 with more than 2GB shared memory

2008-12-10 Thread Hell, Robert
Hi,

I'm trying to run PostgreSQL 8.3 on a FreeBSD 7.0 amd64 server with more
than 2GB shared memory. The machine has 32GB RAM installed.
After setting kern.ipc.shmmax and kern.ipc.shmall to the appropriate
values, I still had no chance to start postgres with more than 2GB of
shared memory.

I wrote a small test which does the same as postgres: shmget and shmat:
#include sys/ipc.h
#include sys/shm.h
#include stdio.h
#include errno.h

int main()
{
  int shmid, memKey = 1;
  void *memAddress;
  unsigned long size = 2147483648UL;

  shmid = shmget(memKey, size, IPC_CREAT | IPC_EXCL);
  if (shmid  0) {
printf(shmget failed: %d\n, errno);
return 1;
  }

  memAddress = shmat(shmid, NULL, 0);
  if (memAddress == (void *) -1) {
printf(shmat failed: %d\n, errno);
  }

  return 0;
}


I found out that shmget failed with ENOMEM in shmget_allocate_segment
(sysv_shm.c) because of an overflow of size (requested shared memory in
bytes):
int i, segnum, shmid, size;
...
size = round_page(uap-size);
if (shm_committed + btoc(size)  shminfo.shmall) {
return (ENOMEM);
}

When changing size to an unsigned long shmget works - but now shmat then
fails again with ENOMEM.
Is there any easy way to use a shared memory segment which is larger
than 2GB?

Kind regards,
Robert
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL on FreeBSD 7.0 amd64 with more than 2GB shared memory

2008-12-10 Thread Wojciech Puchar

fails again with ENOMEM.
Is there any easy way to use a shared memory segment which is larger
than 2GB?


getting two smaller ? :)

no idea - maybe it's bug of SHM. as you already checked it please do 
sent-pr

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: PostgreSQL on FreeBSD 7.0 amd64 with more than 2GB shared memory

2008-12-10 Thread Hell, Robert
I just found a bug report for that issue:
http://www.freebsd.org/cgi/query-pr.cgi?pr=121423cat=

Thanks,
Robert

-Original Message-
From: Wojciech Puchar [mailto:[EMAIL PROTECTED] 
Sent: Mittwoch, 10. Dezember 2008 18:30
To: Hell, Robert
Cc: freebsd-questions@freebsd.org
Subject: Re: PostgreSQL on FreeBSD 7.0 amd64 with more than 2GB shared
memory

 fails again with ENOMEM.
 Is there any easy way to use a shared memory segment which is larger
 than 2GB?

getting two smaller ? :)

no idea - maybe it's bug of SHM. as you already checked it please do 
sent-pr
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]