<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Mmap, 32 bit machine, limit</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I'm using the c function "mmap" to memory map binary files into an int**. (on a 32 bit machine).</FONT>

<BR><FONT SIZE=2 FACE="Arial">There are a total of 22 files - the maximum of which is about 450MB.  Since 4 bytes per int, this will imply 112M addresses will be needed.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">So:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">array[0] = file1</FONT>

<BR><FONT SIZE=2 FACE="Arial">array[1] = file2</FONT>

<BR><FONT SIZE=2 FACE="Arial">array[21] = file22</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">In total, these 22 files come to about 3.4GB - roughly 850M addresses.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">However, the function crashes and gives out the message ENOMEM after mapping about 2.6GB.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Does anyone know what's going wrong??? None of it makes sense to me because:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">(a)     if problem was that 2^31 max addresses, then would crash surely after mapping 2^31bytes (less than 2.6)</FONT>

<BR><FONT SIZE=2 FACE="Arial">(b)     problem doesn't seem to be lack of swap space.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Is there a maximum memory limit in mapping?</FONT>
</P>

<P><B><FONT SIZE=2 FACE="Arial">Nigel Rochford</FONT></B>

<BR><FONT SIZE=2 FACE="Arial">Analyst Programmer</FONT>

<BR><FONT SIZE=2 FACE="Arial">+44 306 3563</FONT>
</P>

<FONT SIZE=3><BR>
<BR>
**********************************************************************<BR>
This message is intended only for the use of the individual(s) to which<BR>
it is addressed and may contain information that is privileged and<BR>
confidential.<BR>
  If you are not the intended recipient, you are hereby notified that<BR>
you have received this transmission in error; any review, dissemination,<BR>
distribution or copying of this transmission is strictly prohibited.<BR>
  If you have received this communication in error, please notify us<BR>
immediately by reply e-mail and delete this message and all of its attachments.<BR>
**********************************************************************<BR>
</FONT>
</BODY>
</HTML>