Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 93121 invoked from network); 13 Jul 2009 04:33:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jul 2009 04:33:04 -0000 Received: (qmail 32666 invoked by uid 500); 13 Jul 2009 04:33:14 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 32584 invoked by uid 500); 13 Jul 2009 04:33:13 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 32574 invoked by uid 99); 13 Jul 2009 04:33:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jul 2009 04:33:12 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jayasingh.samuel@hotmail.com designates 65.55.116.43 as permitted sender) Received: from [65.55.116.43] (HELO blu0-omc1-s32.blu0.hotmail.com) (65.55.116.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jul 2009 04:33:01 +0000 Received: from BLU123-W5 ([65.55.116.8]) by blu0-omc1-s32.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 12 Jul 2009 21:32:40 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_9632d7ea-8aa2-4a25-9143-e1e606322b74_" X-Originating-IP: [124.124.231.235] From: Jaysingh Samuel To: Subject: RE: Memory leaks on adding module directives on virtual host. Date: Mon, 13 Jul 2009 10:02:40 +0530 Importance: Normal In-Reply-To: <1247167688.7542.22.camel@vostro.crrrwg.de> References: <20170a030907080005t1bab21fcj64483e9f36297951@mail.gmail.com> <1247082366.5380.29.camel@vostro.crrrwg.de> <1247167688.7542.22.camel@vostro.crrrwg.de> MIME-Version: 1.0 X-OriginalArrivalTime: 13 Jul 2009 04:32:40.0288 (UTC) FILETIME=[F4DED600:01CA0372] X-Virus-Checked: Checked by ClamAV on apache.org --_9632d7ea-8aa2-4a25-9143-e1e606322b74_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thanks all for your reply. I store a structure in the serverConfig and most of the member get sets fro= m the http config directives.. Two member of this structure are pointed to = a hash Table which is not a apr.. This hash Table i create on post_config a= nd added a cleanup function in the postConfig.=20 And for supporting the virtual host=2C i have server config Merger where i = have another copy of the serverConfig and i set the members with the direct= ives found in the http config and if not found will copy the base server Co= nfig directives.=20 The hash table i don't copy instead i just copy the pointer of the base Ser= ver config to the virtual config. =20 I guess the memory leak is because of this.=20 Do we have solution where we can use the base Server hast table in the virt= ual host without any Memory Leak? Thanks in advance=2C Jaysingh > Subject: RE: Memory leaks on adding module directives on virtual host. > From: jzobel@heute-morgen.de > To: jayasingh.samuel@hotmail.com > CC: modules-dev@httpd.apache.org > Date: Thu=2C 9 Jul 2009 21:28:08 +0200 >=20 > Am Donnerstag=2C den 09.07.2009=2C 09:11 +0530 schrieb Jaysingh Samuel: > > In the command table we get the serverConfig pointer and store the > > value like the following.=20 > > serverConf =3D > > ap_get_module_config(parms->server->module_config=2C &xyz_module)=3B=20 > >=20 > > serverConf->abc =3D apr_pstrdup(parms->pool=2C arg)=3B >=20 > This looks OK and you should not need any cleanup function to free the > memory allocated by apr_strdup. You don't allocate any memory with > malloc or the like? >=20 > You could however use apr_pool_cleanup_register on the parms->pool to > register a cleanup function that writes a log entry every time the pool > is cleared or destroyed. >=20 > Sincerely=2C > Joachim >=20 >=20 _________________________________________________________________ Stay updated! Add Facebook=2C LinkedIn=2C MySpace & Hi5 friends to your Wi= ndows Live network instantly. Add Now! http://profile.live.com/webactivities/?mkt=3Den-in= --_9632d7ea-8aa2-4a25-9143-e1e606322b74_--