Index: lucene/src/java/org/apache/lucene/store/MMapDirectory.java =================================================================== --- lucene/src/java/org/apache/lucene/store/MMapDirectory.java (revision 1059628) +++ lucene/src/java/org/apache/lucene/store/MMapDirectory.java (working copy) @@ -79,7 +79,7 @@ */ public class MMapDirectory extends FSDirectory { private boolean useUnmapHack = UNMAP_SUPPORTED; - public static final int DEFAULT_MAX_BUFF = Constants.JRE_IS_64BIT ? Integer.MAX_VALUE : (256 * 1024 * 1024); + public static final int DEFAULT_MAX_BUFF = (Constants.JRE_IS_64BIT && !Constants.WINDOWS) ? Integer.MAX_VALUE : (256 * 1024 * 1024); private int maxBBuf = DEFAULT_MAX_BUFF; /** Create a new MMapDirectory for the named location. @@ -176,12 +176,13 @@ /** * Sets the maximum chunk size (default is {@link Integer#MAX_VALUE} for - * 64 bit JVMs and 256 MiBytes for 32 bit JVMs) used for memory mapping. + * 64 bit non-Windows JVMs and 256 MiBytes for 32 bit and Windows JVMs) + * used for memory mapping. * Especially on 32 bit platform, the address space can be very fragmented, * so large index files cannot be mapped. * Using a lower chunk size makes the directory implementation a little * bit slower (as the correct chunk must be resolved on each seek) - * but the chance is higher that mmap does not fail. On 64 bit + * but the chance is higher that mmap does not fail. On 64 bit non-Windows * Java platforms, this parameter should always be {@link Integer#MAX_VALUE}, * as the address space is big enough. */