Return-Path: X-Original-To: apmail-apr-dev-archive@www.apache.org Delivered-To: apmail-apr-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D344D11D34 for ; Thu, 17 Jul 2014 19:52:24 +0000 (UTC) Received: (qmail 85742 invoked by uid 500); 17 Jul 2014 19:52:24 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 85661 invoked by uid 500); 17 Jul 2014 19:52:24 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 85652 invoked by uid 99); 17 Jul 2014 19:52:24 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Jul 2014 19:52:24 +0000 Received: by minotaur.apache.org (Postfix, from userid 2161) id 456C411D33; Thu, 17 Jul 2014 19:52:24 +0000 (UTC) Received: from [IPv6:::1] (localhost [IPv6:::1]) by gauss.localdomain (Postfix) with ESMTP id BEA3A1B7 for ; Thu, 17 Jul 2014 21:51:55 +0200 (CEST) Message-ID: <53C8295B.4030304@apache.org> Date: Thu, 17 Jul 2014 21:51:55 +0200 From: Ruediger Pluem User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26.1 MIME-Version: 1.0 To: APR Developer List Subject: Re: Possible memory leak involved in ap_rflush and friends? References: <53C7DE66.5040000@christopherschultz.net> In-Reply-To: <53C7DE66.5040000@christopherschultz.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Christopher Schultz wrote: > All, > > A user recently reported a problem with mod_jk leaking memory 8k at a time when a certain option was enabled in the > mod_jk configuration. He included a "debugdiag" (some kinda Windows thing) trace of where memory was being > allocated and the trace goes from mod_jk into httpd/apr. > > The code in mod_jk is pretty straightforward in the ws_flush function: > > static void JK_METHOD ws_flush(jk_ws_service_t *s) { #if ! (defined(AS400) && !defined(AS400_UTF8)) if (s && > s->ws_private) { apache_private_data_t *p = s->ws_private; ap_rflush(p->r); ap_rflush creates a new brigade each time from the r->pool. So if you call it often this can sum up. In this case you better do the code of ap_rflush in your code and reuse the brigade instead of creating it again each time. Regards RĂ¼diger -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/ iQIcBAEBCgAGBQJTyClbAAoJEObVvtFRhboc9VQP/jhlDMFQh6TXw8Yb+MvyGlgU KScUQnpTOGqq4aV3SCb+FZT7+AjKU92JmM++CTVEGeZ5LD75vvP5H/1otsQYsTqe cS45q7f1HGB+6hsvnisvreAOS5lfD5RNOcEQiDjWIO4Wn3LUNn7p0aNBoPPVG2/N 7UfUvlZzoprseEdaXDVZBjcYWPeA7x+h51nrYr0wbts1PUO6tZ6oYkakKilgaYSi s3J3RByKksK1KXyrB9keKuGqyJU0XICy3Htm6EhKXdCUwjWEYzQTm5gQBfwBR1wI nG5tXG1FKVsSsQuNTLCwswWvIC0Y0esy+QEia+dXtrZhhn9+DYN2nFnsLHSRO3Sd V+n1XYJD5jVVrpOTa6fdvXaNpONv/F10h+KsFH7XvaI8JAL3UbpTZGMNHDbDZHgB qzn7+RNn9ye7BZ7UrSeWneLlr4clPCDJIlFy7aCM7RbkTE4EWDRGdqLSJ9SL8JwL IXD9yIjwrxt+lPAPRur4wF5pxBtw2Tvaffd2a/7N61LORoIbGL7QvRZn7kExbhxM ylMl/+oY1o1P+zrd8W4GB+bySN4gweNH8sD99pXfUHc2feONOuX4kign162Dgq3M B3BHEVc2thKAGFevRo4HfrUIMjX4Oj9ynuiiwIqRJETHtYksggtmI8KEiV78XrL8 VnOClYGTay+mBjRMrKvc =J81i -----END PGP SIGNATURE-----