@@ -233,8 +233,8 @@ static boolean useDelegate(String name, IOContext ioContext) {
233233 }
234234
235235 /**
236- * Force not using mmap if file is tmp fdm, fdx and fdt files .
237- * The tmp fdm, fdx, fdt file only gets created when flushing stored
236+ * Force not using mmap if file is tmp fdt file .
237+ * The tmp fdt file only gets created when flushing stored
238238 * fields to disk and index sorting is active.
239239 * <p>
240240 * In Lucene, the <code>SortingStoredFieldsConsumer</code> first
@@ -252,17 +252,17 @@ static boolean useDelegate(String name, IOContext ioContext) {
252252 * <p>
253253 * As part of flushing stored disk when indexing sorting is active,
254254 * three tmp files are created, fdm (metadata), fdx (index) and
255- * fdt (contains stored field data). All tmp files avoid using mmmp directory.
255+ * fdt (contains stored field data). The first two files are small and
256+ * mmap-ing that should still be ok even is memory is scarce.
257+ * The fdt file is large and tends to cause more page faults when memory is scarce.
256258 *
257259 * @param name The name of the file in Lucene index
258260 * @param extension The extension of the in Lucene index
259261 * @return whether to avoid using delegate if the file is a tmp fdt file.
260262 */
261263 static boolean avoidDelegateForFdtTempFiles (String name , LuceneFilesExtensions extension ) {
262264 // NOTE, for now gated behind feature flag to observe impact of this change in benchmarks only:
263- return TMP_FDT_NO_MMAP_FEATURE_FLAG .isEnabled ()
264- && extension == LuceneFilesExtensions .TMP
265- && (name .contains ("fdt" ) || name .contains ("fdx" ) || name .contains ("fdm" ));
265+ return TMP_FDT_NO_MMAP_FEATURE_FLAG .isEnabled () && extension == LuceneFilesExtensions .TMP && name .contains ("fdt" );
266266 }
267267
268268 MMapDirectory getDelegate () {
0 commit comments