[geos-devel] [GEOS] #923: Memory leak in GEOSNode

GEOS geos-trac at osgeo.org
Wed Sep 19 17:05:38 PDT 2018


#923: Memory leak in GEOSNode
-------------------------+---------------------------
 Reporter:  Algunenano   |       Owner:  geos-devel@…
     Type:  defect       |      Status:  new
 Priority:  major        |   Milestone:  3.8.0
Component:  Default      |     Version:  master
 Severity:  Significant  |  Resolution:
 Keywords:               |
-------------------------+---------------------------

Comment (by cvvergara):

 I am making a valgrind memory leak test on tag 3.7.0, I am including the
 test file submitted by @algunenano

 {{{
 $ git checkout 3.7.0
 M       .editorconfig
 M       CMakeLists.txt
 M       tests/CMakeLists.txt
 A       tests/issue923/CMakeLists.txt
 A       tests/issue923/Makefile.am
 A       tests/issue923/geos_leak.c
 Note: checking out '3.7.0'.

 You are in 'detached HEAD' state. You can look around, make experimental
 changes and commit them, and you can discard any commits you make in this
 state without impacting any branches by performing another checkout.

 If you want to create a new branch to retain commits you create, you may
 do so (now or later) by using -b with the checkout command again. Example:

   git checkout -b <new-branch-name>

 HEAD is now at 673b993... Prepare for 3.7.0 release
 $ make -j 2 && time ctest -T memcheck
 [  0%] Built target geos_revision
 [ 38%] Built target geos
 [ 39%] Built target geos_c
 [ 41%] Built target test_xmltester
 [ 80%] Built target geos-static
 [ 80%] Built target test_simplewkttester
 [ 80%] Built target test_sweep_line_speed
 [ 80%] Built target perf_class_sizes
 [ 80%] Built target test_bug234
 [ 81%] Built target perf_iterated_buffer
 [ 81%] Built target perf_rectangle_intersects
 [ 81%] Built target perf_memleak_mp_prep
 [ 81%] Built target perf_geos_leak
 [100%] Built target test_geos_unit
    Site: vicky-desktop
    Build name: Linux-c++
 Memory check project /home/vicky/geos/vicky/build
     Start 1: test_geos_unit
 1/9 MemCheck #1: test_geos_unit ...................   Passed   27.61 sec
     Start 2: test_xmltester
 2/9 MemCheck #2: test_xmltester ...................   Passed  393.84 sec
     Start 3: test_bug234
 3/9 MemCheck #3: test_bug234 ......................   Passed    1.55 sec
     Start 4: test_sweep_line_speed
 4/9 MemCheck #4: test_sweep_line_speed ............   Passed   50.89 sec
     Start 5: perf_class_sizes
 5/9 MemCheck #5: perf_class_sizes .................   Passed    0.51 sec
     Start 6: perf_iterated_buffer
 6/9 MemCheck #6: perf_iterated_buffer .............   Passed  720.40 sec
     Start 7: perf_rectangle_intersects
 7/9 MemCheck #7: perf_rectangle_intersects ........   Passed   20.56 sec
     Start 8: perf_memleak_mp_prep
 8/9 MemCheck #8: perf_memleak_mp_prep .............   Passed  600.99 sec
     Start 9: perf_geos_leak
 9/9 MemCheck #9: perf_geos_leak ...................   Passed    1.00 sec

 100% tests passed, 0 tests failed out of 9

 Total Test time (real) = 1817.34 sec
 -- Processing memory checking output: ########
 Memory checking results:
 Memory Leak - 69
 Potential Memory Leak - 23

 real    30m17.426s
 user    30m5.035s
 sys     0m3.905s
 }}}


 As you can see version 3.7.0 tests have
 {{{
 Memory Leak - 69
 Potential Memory Leak - 23
 }}}

 By doing the valgrind test only on perf_geos_leak, it shows only
 `Potential Memory Leak - 3`

 {{{
 make -j 2 && ctest -T memcheck -R perf_geos_leak
 [  0%] Built target geos_revision
 [ 38%] Built target geos
 [ 77%] Built target geos-static
 [ 78%] Built target geos_c
 [ 80%] Built target test_xmltester
 [ 80%] Built target test_simplewkttester
 [ 80%] Built target test_sweep_line_speed
 [ 80%] Built target test_bug234
 [ 80%] Built target perf_class_sizes
 [ 81%] Built target perf_iterated_buffer
 [ 81%] Built target perf_rectangle_intersects
 [ 81%] Built target perf_memleak_mp_prep
 [ 81%] Built target perf_geos_leak
 [100%] Built target test_geos_unit
    Site: vicky-desktop
    Build name: Linux-c++
 Create new tag: 20180920-0002 - Experimental
 Memory check project /home/vicky/geos/vicky/build
     Start 9: perf_geos_leak
 1/1 MemCheck #9: perf_geos_leak ...................   Passed    1.03 sec

 100% tests passed, 0 tests failed out of 1

 Total Test time (real) =   1.03 sec
 -- Processing memory checking output:
 Memory checking results:
 Potential Memory Leak - 3
 }}}

 Will do the test on master results will be posted on a next comment

-- 
Ticket URL: <https://trac.osgeo.org/geos/ticket/923#comment:12>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).


More information about the geos-devel mailing list