Re: data.tmp: file too big [SOLVED]

Mark Johnson <[email protected]>
Newsgroups gmane.network.djbdns
Message-ID <[email protected]>
On Tue, May 19, 2009 at 4:22 AM, Jakob Hirsch <[email protected]> wrote:
> Hugo Monteiro, 2009-05-19 01:45:
>
>> Adding -D_FILE_OFFSET_BITS=64 to the compilation flags did the trick. I
>> now have a 2.9G data.cdb file. The bad news is that apparently tinydns/the
>> system isn't capable of coping with that volume of information.
>
> With a 2.9G file, you are probably running into the 3G userspace memory
> limit of the Linux kernel's default 3G/1G kernel/userland memory split.
> Unfortunately, you can only change that by recompiling the kernel, but
> 3.5G/0.5G is the most you can get, but I would not recommend that, as it
> could be too less for the kernel and you will run into the same problem
> soon. So I guess you have two options:
> - split your data file and run 2 or more tinydns processes
> - switch over to a 64 bit system

Something else to try, if you really need > 2G cdb file in a 32-bit
environment, might be to change cdb.c to *not* mmap the cdb file.
According to this bit of cdb_init (cdb.c):

 if (fstat(fd,&st) == 0)
    if (st.st_size <= 0xffffffff) {
      x = mmap(0,st.st_size,PROT_READ,MAP_SHARED,fd,0);
      if (x + 1) {
        c->size = st.st_size;
        c->map = x;
      }
    }

it won't mmap the file if it's > 4G?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.