tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 43873] New: - mod_jk memory leak when apache graceful restart
Date Thu, 15 Nov 2007 15:18:33 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43873>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43873

           Summary: mod_jk memory leak when apache graceful restart
           Product: Tomcat 5
           Version: Unknown
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Native:JK
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: mashmk02@gmail.com


In jk_set_time_fmt(),  memory area is allocated by the following codes. 
 fmt = (char *)malloc(JK_TIME_MAX_SIZE + strlen(JK_TIME_PATTERN_MICRO));
But this area is not released. 

When i restart apache with graceful mode, apache master process causes the
memory leak a little.
I tested in the following environments.
 RHEL4.5(Apache2.0.52) + mod_jk 1.2.25/1.2.26-dev

I made following patch for apache-2.0/mod_jk.c.
===================================================================
--- mod_jk/native/apache-2.0/mod_jk.c   (revision 594009)
+++ mod_jk/native/apache-2.0/mod_jk.c   (working copy)
@@ -2605,6 +2605,13 @@
         jkl->log = jk_log_to_file;
         jkl->level = conf->log_level;
         jk_set_time_fmt(jkl, conf->stamp_format_string);
+        char *log_fmt_subsec = (char *)jkl->log_fmt_subsec;
+        if ( log_fmt_subsec != NULL ) {
+            if (jkl->log_fmt_size > 0)
+                jkl->log_fmt_subsec = apr_pstrdup(p, jkl->log_fmt_subsec);
+            free((void*)log_fmt_subsec);
+        }
+
         jkl->logger_private = flp;
         flp->jklogfp = conf->jklogfp;
         conf->log = jkl;

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message