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 08ADB1037F for ; Wed, 7 Aug 2013 13:46:38 +0000 (UTC) Received: (qmail 98772 invoked by uid 500); 7 Aug 2013 13:46:35 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 98698 invoked by uid 500); 7 Aug 2013 13:46:34 -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 98303 invoked by uid 99); 7 Aug 2013 13:46:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Aug 2013 13:46:33 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [209.85.128.180] (HELO mail-ve0-f180.google.com) (209.85.128.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Aug 2013 13:46:29 +0000 Received: by mail-ve0-f180.google.com with SMTP id pb11so1777688veb.39 for ; Wed, 07 Aug 2013 06:45:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=xanowx9kssGt+H90MqfhBx4VsM7AffmJkA0gFrVxew0=; b=Ilvj9v5NHXIQsIOISLymw4dqWYxAwvYrIJl9hnsmqzzBoKFc0CiG0EXd2rtIScXn1E X6HaCMQNvCqHkO8GS3SikEqQSRWQUAR9j1DOgzF/xiL8VkmczEPpJtedIYeEZSyr5m7A 2DaQcY+5+3qmwzNqTI8QDX2a+CN9ODzm9u8wnk1+gtdEAHSUDPBtOSyjynfCzZOyDaj0 e3aav+8t3TPiLBC6T0qQSyATVvmjUohUoA5Z7cby9whMnRot3vuo7vGfekB4ES3o+Gz/ QU5IsxLBMs+0vmKfT7UDm04/JZbu69fLZZ+Ck0RjZIH6lwDerHIyO9kps2qj3e4lMw55 MpDA== X-Gm-Message-State: ALoCoQk3XRLwe0hEZUBQv6gQZMXS1/Y949Z/vPuMpI+Y+J5E1ZpjAjqotQ9ilc5AixZQCBQg9uEO X-Received: by 10.58.236.70 with SMTP id us6mr330867vec.89.1375883148227; Wed, 07 Aug 2013 06:45:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.20.130 with HTTP; Wed, 7 Aug 2013 06:45:28 -0700 (PDT) In-Reply-To: References: From: Michael McCandless Date: Wed, 7 Aug 2013 09:45:28 -0400 Message-ID: Subject: Re: WeakIdentityMap high memory usage To: Lucene Users Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org This map is used to track all cloned open files, which can be a very large number over time (each search will create maybe 3 of them). This is done as a "best effort" to prevent SEGV (JVM dies) if you accidentally try to use an IndexReader after it was closed, while using MMapDirectory. However, it's a weak map, which means when HEAP is tight GC should drop it. So, this should not cause a real problem in "real life", even though it looks scary when you look at its RAM usage under a profiler. If somehow it's causing "real life" problems, please report back! But a simple workaround is to call MMapDirectory.setUseUnmap(false) to turn off this tracking; this means you rely on GC to (eventually) unmap. Mike McCandless http://blog.mikemccandless.com On Wed, Aug 7, 2013 at 2:45 AM, Denis Bazhenov wrote= : > We have upgraded from Lucene 3.6 to 4.4.On the production we faced high m= inor GC time. Heap dump showed that one of the biggest objects by size is o= rg.apache.lucene.util.WeakIdentityMap$IdentityWeakReference. About 11 milli= on instances with about 377 megabytes of memory in total (this is not even = retained size). Here is screenshot of the JProfiler output: https://dl.drop= boxusercontent.com/u/16254496/Screen%20Shot%202013-08-07%20at%205.35.22%20P= M.png. > > The keys of the map are MMapIndexInput. What this map is for and how can = I reduce it memory usage? > --- > Denis Bazhenov > FarPost. > > > --------------------------------------------------------------------- > 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