Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 95809200BEE for ; Sat, 31 Dec 2016 16:49:32 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 898EB160B28; Sat, 31 Dec 2016 15:49:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D2101160B16 for ; Sat, 31 Dec 2016 16:49:31 +0100 (CET) Received: (qmail 66741 invoked by uid 500); 31 Dec 2016 15:49:31 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 66731 invoked by uid 99); 31 Dec 2016 15:49:31 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Dec 2016 15:49:31 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 54C463A022C for ; Sat, 31 Dec 2016 15:49:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1776780 - /subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c Date: Sat, 31 Dec 2016 15:49:29 -0000 To: commits@subversion.apache.org From: stefan2@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161231154930.54C463A022C@svn01-us-west.apache.org> archived-at: Sat, 31 Dec 2016 15:49:32 -0000 Author: stefan2 Date: Sat Dec 31 15:49:29 2016 New Revision: 1776780 URL: http://svn.apache.org/viewvc?rev=1776780&view=rev Log: Reduce the memory usage of the svn-mergeinfo-normalizer tool by tightening pool usage. * tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c (parse_mergeinfo): Actually use the ITERPOOL that we have. (svn_min__read_mergeinfo): Add another pool for temporary data and clean temp pools asap. Modified: subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c Modified: subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c URL: http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c?rev=1776780&r1=1776779&r2=1776780&view=diff ============================================================================== --- subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c (original) +++ subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c Sat Dec 31 15:49:29 2016 @@ -88,7 +88,7 @@ parse_mergeinfo(apr_array_header_t **res svn_string_t *mi_string = apr_hash_this_val(hi); svn_pool_clear(iterpool); - SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mi_string->data, scratch_pool)); + SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mi_string->data, iterpool)); entry->local_path = apr_pstrdup(result_pool, apr_hash_this_key(hi)); entry->mergeinfo = svn_mergeinfo_dup(mergeinfo, result_pool); @@ -200,7 +200,10 @@ svn_min__read_mergeinfo(apr_array_header svn_min__opt_state_t *opt_state = baton->opt_state; svn_client_ctx_t *ctx = baton->ctx; + /* Pools for temporary data - to be cleaned up asap as they + * significant amounts of it. */ apr_pool_t *props_pool = svn_pool_create(scratch_pool); + apr_pool_t *props_scratch_pool = svn_pool_create(scratch_pool); apr_hash_t *props; const svn_opt_revision_t rev_working = { svn_opt_revision_working }; @@ -214,12 +217,14 @@ svn_min__read_mergeinfo(apr_array_header baton->local_abspath, &rev_working, &rev_working, NULL, opt_state->depth, NULL, ctx, - props_pool, scratch_pool)); - SVN_ERR(parse_mergeinfo(result, props, result_pool, scratch_pool)); - SVN_ERR(link_parents(*result, baton, scratch_pool)); + props_pool, props_scratch_pool)); + svn_pool_destroy(props_scratch_pool); + SVN_ERR(parse_mergeinfo(result, props, result_pool, scratch_pool)); svn_pool_destroy(props_pool); + SVN_ERR(link_parents(*result, baton, scratch_pool)); + if (!baton->opt_state->quiet) SVN_ERR(svn_min__print_mergeinfo_stats(*result, scratch_pool));