Samisa, thank you; I checked out the SVN trunk version, build it and
run the test again.

On the server side (mod_axis2) there is no more memory leaks: I run
the test with 100000 iterations, it took 4 minutes, httpd process
memory usage is stable and is not increasing.

But now there is a memory leak on the client side. I noticed that my
modified echo client (I modified the sample code to run the requests
in a loop) increases the memory usage all the time.

Then I compiled the original, unmodified echo.c sample from the
samples/client/echo directory, and run it through the valgrind. I'm
attaching the valgrind's log file; in a hope that this will help to
fix this. According to the valgrind log, there is a 6K bytes that
valgrind decided are 'definitely lost'.



Thank you,

    alex.


On Tue, Apr 8, 2008 at 9:21 AM, Samisa Abeysinghe <[EMAIL PROTECTED]> wrote:
> Local pools have been integrated to mod_axis2 in Axis2/C trunk.
>
>  You may run the tests again and see the improved memory footprint.
>
>  Samisa...
>
>
>
>  Samisa Abeysinghe wrote:
>
> > Alex Bolgarov wrote:
> >
> > > On Mon, Mar 31, 2008 at 11:17 PM, Uthaiyashankar <[EMAIL PROTECTED]>
> wrote:
> > >
> > >
> > > >  I doubt whether it is a memory leak. When using mod_axis2, memory
> > > >  management is done by apache apr. Memory is released only when pools
> are
> > > >  destroyed. Memory will not be released when calling AXIS2_FREE.
> > > >  (axis2_module_free is implemented in mod_axis2.c:412 and it is an
> empty
> > > >  method unless the pool associated with is global shared pool).
> > > >
> > > >
> > >
> > > Well, we can of course discuss the meaning of a term 'memory leak',
> > > but what happens here is awfully close to any sensible definition :)
> > >
> > > Thank you for pointing out that the mod_axis2 does not really release
> > > memory by design.
> > >
> >
> > What we are using is APR model of pools. So you cannot say that we are not
> releasing memory by design. We are depending on APR pools to release memory
> by design.
> > We have looked deep into this issue in the past, and proven that the
> request pool is reclaimed by main pool upon request completion.
> >
> >
> > > How do you think what happens if I change the
> > > allocator used by mod_axis2 to use malloc()/free(), not the APR's
> > > apr_pool_...() functions? Will the memory leak go away?.. Actually,
> > > this is exactly what I'm going to do. I have some experience in
> > > developing Apache httpd modules, and I write them in C++ and freely
> > > use new/delete operators, so I know that using a memory allocator
> > > other then APR's pool functions in the httpd process is OK.
> > >
> >
> > If you go and discuss this with httpd or apr list, they will sure tell you
> that this is the wrong way to do that.
> >
> > There are better ways of doing this, like using using local pools, which
> we are going to implement soon.
> >
> > Samisa...
> >
> >
> > > I will
> > > report my findings here, hopefully in a couple of days.
> > >
> > >
> > > Thank you,
> > >
> > >    alex.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>  --
>  Samisa Abeysinghe Software Architect; WSO2 Inc.
>
>  http://www.wso2.com/ - "Oxygenating the Web Service Platform."
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>
==11927== Memcheck, a memory error detector.
==11927== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==11927== Using LibVEX rev 1732, a library for dynamic binary translation.
==11927== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==11927== Using valgrind-3.2.3-Debian, a dynamic binary instrumentation framework.
==11927== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==11927== For more details, rerun with: -v
==11927==
==11927== Invalid read of size 4
==11927==    at 0x0427820c: guththila_next_char (guththila_xml_parser.c:1555)
==11927==    by 0x04278ad4: guththila_next (guththila_xml_parser.c:790)
==11927==    by 0x0407643b: guththila_xml_reader_wrapper_next (guththila_xml_reader_wrapper.c:405)
==11927==    by 0x040745f6: axiom_xml_reader_next (xml_reader.c:26)
==11927==    by 0x0405f79e: axiom_stax_builder_next (om_stax_builder.c:807)
==11927==    by 0x040561c8: axiom_document_build_next (om_document.c:118)
==11927==    by 0x04056260: axiom_document_get_root_element (om_document.c:151)
==11927==    by 0x04056388: axiom_document_build_all (om_document.c:197)
==11927==    by 0x040abfe2: axis2_desc_builder_build_om (desc_builder.c:206)
==11927==    by 0x040b65d2: axis2_conf_builder_populate_conf (conf_builder.c:157)
==11927==    by 0x040aeec2: axis2_dep_engine_load_client (dep_engine.c:943)
==11927==    by 0x040b86ee: axis2_build_client_conf_ctx (conf_init.c:192)
==11927==    Address 0x443DB94 is 4 bytes before a block of size 16 alloc'd
==11927==    at 0x04022765: malloc (vg_replace_malloc.c:149)
==11927==    by 0x0402f98c: axutil_allocator_malloc_impl (allocator.c:74)
==11927==    by 0x04276162: guththila_buffer_init (guththila_buffer.c:28)
==11927==    by 0x0427a8e6: guththila_init (guththila_xml_parser.c:148)
==11927==    by 0x040766b4: axiom_xml_reader_create_for_file (guththila_xml_reader_wrapper.c:221)
==11927==    by 0x040abfa9: axis2_desc_builder_build_om (desc_builder.c:171)
==11927==    by 0x040b65d2: axis2_conf_builder_populate_conf (conf_builder.c:157)
==11927==    by 0x040aeec2: axis2_dep_engine_load_client (dep_engine.c:943)
==11927==    by 0x040b86ee: axis2_build_client_conf_ctx (conf_init.c:192)
==11927==    by 0x040c85b2: axis2_svc_client_init_transports_from_conf_ctx (svc_client.c:1165)
==11927==    by 0x040c8691: axis2_svc_client_create_with_conf_ctx_and_svc (svc_client.c:292)
==11927==    by 0x040c8bd3: axis2_svc_client_create (svc_client.c:117)
==11927==
==11927== Invalid free() / delete / delete[]
==11927==    at 0x0402237f: free (vg_replace_malloc.c:233)
==11927==    by 0x0421100b: free_mem (dl-libc.c:235)
==11927==    by 0x04210b53: __libc_freeres (set-freeres.c:47)
==11927==    by 0x0401e216: _vgnU_freeres (vg_preloaded.c:60)
==11927==    by 0x0413f5f7: exit (exit.c:90)
==11927==    by 0x04129057: ??? (below main:0)
==11927==    Address 0x410E880 is not stack'd, malloc'd or (recently) free'd
==11927==
==11927== ERROR SUMMARY: 8 errors from 2 contexts (suppressed: 47 from 1)
==11927== malloc/free: in use at exit: 6,305 bytes in 135 blocks.
==11927== malloc/free: 6,199 allocs, 6,065 frees, 420,216 bytes allocated.
==11927== For counts of detected errors, rerun with: -v
==11927== searching for pointers to 135 not-freed blocks.
==11927== checked 261,156 bytes.
==11927==
==11927== 20 bytes in 1 blocks are still reachable in loss record 1 of 4
==11927==    at 0x04021aa4: calloc (vg_replace_malloc.c:279)
==11927==    by 0x0411013b: _dlerror_run (dlerror.c:142)
==11927==    by 0x0410fb4b: dlopen@@GLIBC_2.1 (dlopen.c:87)
==11927==    by 0x0403739b: axutil_class_loader_load_lib (class_loader.c:156)
==11927==    by 0x04037542: axutil_class_loader_create_dll (class_loader.c:76)
==11927==    by 0x040b5352: axis2_conf_builder_process_transport_senders (conf_builder.c:884)
==11927==    by 0x040b6d06: axis2_conf_builder_populate_conf (conf_builder.c:257)
==11927==    by 0x040aeec2: axis2_dep_engine_load_client (dep_engine.c:943)
==11927==    by 0x040b86ee: axis2_build_client_conf_ctx (conf_init.c:192)
==11927==    by 0x040c85b2: axis2_svc_client_init_transports_from_conf_ctx (svc_client.c:1165)
==11927==    by 0x040c8691: axis2_svc_client_create_with_conf_ctx_and_svc (svc_client.c:292)
==11927==    by 0x040c8bd3: axis2_svc_client_create (svc_client.c:117)
==11927==
==11927== 111 bytes in 4 blocks are indirectly lost in loss record 2 of 4
==11927==    at 0x04022765: malloc (vg_replace_malloc.c:149)
==11927==    by 0x0402f98c: axutil_allocator_malloc_impl (allocator.c:74)
==11927==    by 0x0427a873: guththila_init (guththila_xml_parser.c:170)
==11927==    by 0x040765cf: axiom_xml_reader_create_for_io (guththila_xml_reader_wrapper.c:289)
==11927==    by 0x040d10b2: axis2_http_transport_utils_create_soap_msg (http_transport_utils.c:1991)
==11927==    by 0x040fa226: axis2_http_transport_sender_write_message (http_transport_sender.c:800)
==11927==    by 0x040faaad: axis2_http_transport_sender_invoke (http_transport_sender.c:309)
==11927==    by 0x0409cf56: axis2_engine_send (engine.c:176)
==11927==    by 0x040c4187: axis2_op_client_two_way_send (op_client.c:1140)
==11927==    by 0x040c5a76: axis2_op_client_execute (op_client.c:500)
==11927==    by 0x040c7ef7: axis2_svc_client_send_receive_with_op_qname (svc_client.c:851)
==11927==    by 0x040c81e2: axis2_svc_client_send_receive (svc_client.c:949)
==11927==
==11927== 200 bytes in 2 blocks are still reachable in loss record 3 of 4
==11927==    at 0x04022765: malloc (vg_replace_malloc.c:149)
==11927==    by 0x0400bb29: _dl_map_object_deps (in /lib/ld-2.6.1.so)
==11927==    by 0x04010fe3: dl_open_worker (in /lib/ld-2.6.1.so)
==11927==    by 0x0400d015: _dl_catch_error (in /lib/ld-2.6.1.so)
==11927==    by 0x0401099d: _dl_open (in /lib/ld-2.6.1.so)
==11927==    by 0x0410fc1b: dlopen_doit (dlopen.c:66)
==11927==    by 0x0400d015: _dl_catch_error (in /lib/ld-2.6.1.so)
==11927==    by 0x041100cb: _dlerror_run (dlerror.c:164)
==11927==    by 0x0410fb4b: dlopen@@GLIBC_2.1 (dlopen.c:87)
==11927==    by 0x0403739b: axutil_class_loader_load_lib (class_loader.c:156)
==11927==    by 0x04037542: axutil_class_loader_create_dll (class_loader.c:76)
==11927==    by 0x040b5352: axis2_conf_builder_process_transport_senders (conf_builder.c:884)
==11927==
==11927== 6,085 (5,974 direct, 111 indirect) bytes in 128 blocks are definitely lost in loss record 4 of 4
==11927==    at 0x04022765: malloc (vg_replace_malloc.c:149)
==11927==    by 0x0402f98c: axutil_allocator_malloc_impl (allocator.c:74)
==11927==    by 0x042776a9: guththila_get_value (guththila_xml_parser.c:1352)
==11927==    by 0x04076276: guththila_xml_reader_wrapper_get_value (guththila_xml_reader_wrapper.c:492)
==11927==    by 0x04074717: axiom_xml_reader_get_value (xml_reader.c:86)
==11927==    by 0x0405e8de: axiom_stax_builder_create_om_comment (om_stax_builder.c:600)
==11927==    by 0x0405f888: axiom_stax_builder_next (om_stax_builder.c:857)
==11927==    by 0x040561ff: axiom_document_build_next (om_document.c:131)
==11927==    by 0x0405633f: axiom_document_build_all (om_document.c:204)
==11927==    by 0x040abfe2: axis2_desc_builder_build_om (desc_builder.c:206)
==11927==    by 0x040b65d2: axis2_conf_builder_populate_conf (conf_builder.c:157)
==11927==    by 0x040aeec2: axis2_dep_engine_load_client (dep_engine.c:943)
==11927==
==11927== LEAK SUMMARY:
==11927== definitely lost: 5,974 bytes in 128 blocks.
==11927== indirectly lost: 111 bytes in 4 blocks.
==11927== possibly lost: 0 bytes in 0 blocks.
==11927== still reachable: 220 bytes in 3 blocks.
==11927== suppressed: 0 bytes in 0 blocks.
==11927==
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to