Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 65DF3100B7 for ; Wed, 3 Dec 2014 10:55:26 +0000 (UTC) Received: (qmail 28261 invoked by uid 500); 3 Dec 2014 10:55:24 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 28198 invoked by uid 500); 3 Dec 2014 10:55:24 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 28186 invoked by uid 99); 3 Dec 2014 10:55:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Dec 2014 10:55:24 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of uwe@thetaphi.de designates 85.25.204.22 as permitted sender) Received: from [85.25.204.22] (HELO mail.sd-datasolutions.de) (85.25.204.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Dec 2014 10:55:19 +0000 Received: from VEGA (unknown [134.102.55.227]) by mail.sd-datasolutions.de (Postfix) with ESMTPSA id 3D67816F8030E for ; Wed, 3 Dec 2014 10:54:27 +0000 (UTC) X-NSA-Greeting: Dear NSA, have fun with reading and analyzing this e-mail! From: "Uwe Schindler" To: References: In-Reply-To: Subject: RE: how to "load" mmap directory into memory? Date: Wed, 3 Dec 2014 11:54:27 +0100 Message-ID: <03c501d00ee7$820feb60$862fc220$@thetaphi.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGDQ8HKaWBrfCODvQkLYD8hwNKaO50XRA4A Content-Language: de X-Virus-Checked: Checked by ClamAV on apache.org Hi, the first searches are always slower, which is not only caused by the FS = cache. In general, searchers must be warmed, so you execute a set of = search queries or calculate facets initially after opening (or = reopening) an IndexReader. This will have the side effect of also = warming the disk cache. But it also initializes all required structures = inside Lucene. So instead of forcefully loading the whole index files = into fs-cache, its better to use = IndexReaderWarmer(http://lucene.apache.org/core/4_10_2/core/org/apache/lu= cene/index/IndexWriter.IndexReaderWarmer.html), which can be used with = SearcherManager in Lucene to warm searchers. Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: Li Li [mailto:fancyerii@gmail.com] > Sent: Wednesday, December 03, 2014 3:46 AM > To: java-user@lucene.apache.org > Subject: how to "load" mmap directory into memory? >=20 > I am using mmap fs directory in lucene. My index is small (about 3GB = in disk) > and I have plenty of memory available. The problem is that when the = term is > first queried, it's slow. How can I "load" all directory into memory? = One > solution is using many query to "warm" it up. But I can't query all = terms and > maybe some terms are still not in memory. Any other methods? > If I write a script(or java program) to read the index file, will it = load all into > memory if I have enough memory? >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org