ossim-info memory leak occurs for images without .geom

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

ossim-info memory leak occurs for images without .geom

rashadkm
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

David Burken
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave


On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
B B
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

B B
Is there a problem with using an ossimRefPtr for theInstance variables instead of a naked one? If I remember right, I've fixed memory leak warnings like that using boost::shared_ptrs before.

Bryan



On Tue, Jul 29, 2014 at 5:10 PM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer





------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

rashadkm
In reply to this post by David Burken
Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer

sensormodelfactory_instance.diff (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

Oscar Kramer
Hi Rashad,

I'm looking over your changes. It seems the only change of consequence is moving the instance singleton pointer from being a static data member to being a class static defined in the cpp file. I don't see that making any difference though.

There is another change which I think is incorrect:
   char ecgTest[4];
   char ecgTest[4]= { '\0' };

It used to be
   char ecgTest[4];
   char ecgTest[3]= { '\0' };

which was correct.

The getImageGeometry() path in the absence of a geom file follows a very convoluted path. Try tracing through it to see if you're in an infinite recursion. I have seen that before. 

Oscar


From: Rashad M <[hidden email]>
To: David Burken <[hidden email]>
Cc: ossim users <[hidden email]>
Sent: Wednesday, July 30, 2014 4:45 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer



------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

Oscar Kramer


Hi Rashad,

I'm looking over your changes. It seems the only change of consequence is moving the instance singleton pointer from being a static data member to being a class static defined in the cpp file. I don't see that making any difference though.

There is another change which I think is incorrect:
   char ecgTest[4];
   char ecgTest[4]= { '\0' };

It used to be
   char ecgTest[4];
   char ecgTest[3]= { '\0' };

which was correct.

The getImageGeometry() path in the absence of a geom file follows a very convoluted path. Try tracing through it to see if you're in an infinite recursion. I have seen that before. 

Oscar




From: Rashad M <[hidden email]>
To: David Burken <[hidden email]>
Cc: ossim users <[hidden email]>
Sent: Wednesday, July 30, 2014 4:45 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer





------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

rashadkm
In reply to this post by Oscar Kramer
Hi,

On Wed, Jul 30, 2014 at 11:26 AM, Oscar Kramer <[hidden email]> wrote:
Hi Rashad,

I'm looking over your changes. It seems the only change of consequence is moving the instance singleton pointer from being a static data member to being a class static defined in the cpp file. I don't see that making any difference though.

I was looking over singleton class and the destructor is not being called at all. So I tested both verison with static pointer and non-pointer and it seems like using pointer leads to memory leak. 

There is another change which I think is incorrect:
   char ecgTest[4];
   char ecgTest[4]= { '\0' };

It used to be
   char ecgTest[4];
   char ecgTest[3]= { '\0' };

which was correct.

Actually.
   char ecgTest[4];
   input.read((char*)ecgTest, 3);
   char ecgTest[3]= { '\0' };
   input.close();
   if(ossimString(ecgTest) == "eCG")

The above code shows error from valgrind related to strlen... and they are everywhere.
So initializing ecgTest to string terminating wont have any problem as long as
   input.read((char*)ecgTest, 3);

as here first 3 chars get written for sure right?
 

The getImageGeometry() path in the absence of a geom file follows a very convoluted path. Try tracing through it to see if you're in an infinite recursion. I have seen that before. 

I will look this

Oscar


From: Rashad M <[hidden email]>
To: David Burken <[hidden email]>
Cc: ossim users <[hidden email]>
Sent: Wednesday, July 30, 2014 4:45 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer





--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

David Burken
In reply to this post by Oscar Kramer
Hi Rashad,

If you're in the geometry code, note the below warning on infinite loop:

           //---
            // WARNING:
            // Must create/set the geometry at this point or the next call to
            // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
            // as it does a recursive call back to ossimImageHandler::getImageGeometry().
            //---
            if ( !theGeometry )
            {
               theGeometry = new ossimImageGeometry();
            }
Dave




From: "Kramer, Oscar" <[hidden email]>
To: "Rashad M" <[hidden email]>, "David Burken" <[hidden email]>
Cc: "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 5:26:07 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi Rashad,

I'm looking over your changes. It seems the only change of consequence is moving the instance singleton pointer from being a static data member to being a class static defined in the cpp file. I don't see that making any difference though.

There is another change which I think is incorrect:
   char ecgTest[4];
   char ecgTest[4]= { '\0' };

It used to be
   char ecgTest[4];
   char ecgTest[3]= { '\0' };

which was correct.

The getImageGeometry() path in the absence of a geom file follows a very convoluted path. Try tracing through it to see if you're in an infinite recursion. I have seen that before. 

Oscar


From: Rashad M <[hidden email]>
To: David Burken <[hidden email]>
Cc: ossim users <[hidden email]>
Sent: Wednesday, July 30, 2014 4:45 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

rashadkm
Hi,

On Wed, Jul 30, 2014 at 2:21 PM, <[hidden email]> wrote:
Hi Rashad,

If you're in the geometry code, note the below warning on infinite loop:

           //---
            // WARNING:
            // Must create/set the geometry at this point or the next call to
            // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
            // as it does a recursive call back to ossimImageHandler::getImageGeometry().
            //---
            if ( !theGeometry )
            {
               theGeometry = new ossimImageGeometry();
            }
Dave


I am not clear is this in the ossim code or in the library which uses OSSIM.  What I post as valgrind output is running simple ossim-info. Without geom it enters a different path but the problem with factoryclass's destructor not getting called exists. 

So to avoid memory issues I must have a .geom but even if I have a geom the static pointer not getting freed right?. This was a major no no to pass ossim over valgrind.

There are some other such  as initialization of char array noted in Oscar's reply

 



From: "Kramer, Oscar" <[hidden email]>
To: "Rashad M" <[hidden email]>, "David Burken" <[hidden email]>
Cc: "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 5:26:07 AM

Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi Rashad,

I'm looking over your changes. It seems the only change of consequence is moving the instance singleton pointer from being a static data member to being a class static defined in the cpp file. I don't see that making any difference though.

There is another change which I think is incorrect:
   char ecgTest[4];
   char ecgTest[4]= { '\0' };

It used to be
   char ecgTest[4];
   char ecgTest[3]= { '\0' };

which was correct.

The getImageGeometry() path in the absence of a geom file follows a very convoluted path. Try tracing through it to see if you're in an infinite recursion. I have seen that before. 

Oscar


From: Rashad M <[hidden email]>
To: David Burken <[hidden email]>
Cc: ossim users <[hidden email]>
Sent: Wednesday, July 30, 2014 4:45 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer






--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

David Burken
I thought you were in/editing the geometry code.  I think the valgrind thing is a false positive on the static instances.  When the app exits, the memory is returned to the heap.

Dave



From: "Rashad M" <[hidden email]>
To: "Mary Burken" <[hidden email]>
Cc: "Kramer, Oscar" <[hidden email]>, "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 8:50:43 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi,

On Wed, Jul 30, 2014 at 2:21 PM, <[hidden email]> wrote:
Hi Rashad,

If you're in the geometry code, note the below warning on infinite loop:

           //---
            // WARNING:
            // Must create/set the geometry at this point or the next call to
            // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
            // as it does a recursive call back to ossimImageHandler::getImageGeometry().
            //---
            if ( !theGeometry )
            {
               theGeometry = new ossimImageGeometry();
            }
Dave


I am not clear is this in the ossim code or in the library which uses OSSIM.  What I post as valgrind output is running simple ossim-info. Without geom it enters a different path but the problem with factoryclass's destructor not getting called exists. 

So to avoid memory issues I must have a .geom but even if I have a geom the static pointer not getting freed right?. This was a major no no to pass ossim over valgrind.

There are some other such  as initialization of char array noted in Oscar's reply

 




From: "Kramer, Oscar" <[hidden email]>
To: "Rashad M" <[hidden email]>, "David Burken" <[hidden email]>
Cc: "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 5:26:07 AM

Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi Rashad,

I'm looking over your changes. It seems the only change of consequence is moving the instance singleton pointer from being a static data member to being a class static defined in the cpp file. I don't see that making any difference though.

There is another change which I think is incorrect:
   char ecgTest[4];
   char ecgTest[4]= { '\0' };

It used to be
   char ecgTest[4];
   char ecgTest[3]= { '\0' };

which was correct.

The getImageGeometry() path in the absence of a geom file follows a very convoluted path. Try tracing through it to see if you're in an infinite recursion. I have seen that before. 

Oscar


From: Rashad M <[hidden email]>
To: David Burken <[hidden email]>
Cc: ossim users <[hidden email]>
Sent: Wednesday, July 30, 2014 4:45 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer






--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

rashadkm



On Wed, Jul 30, 2014 at 3:31 PM, <[hidden email]> wrote:
I thought you were in/editing the geometry code.  I think the valgrind thing is a false positive on the static instances.  When the app exits, the memory is returned to the heap.

Ok. When looking at valgrind and googling about singleton all pointed to use static variable instead of static pointer variable to leave the deallocation mess to compiler and calling a destructor may not be good enough in this case. 

So I thought its worth to check the current implementation.

Dave



From: "Rashad M" <[hidden email]>
To: "Mary Burken" <[hidden email]>
Cc: "Kramer, Oscar" <[hidden email]>, "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 8:50:43 AM

Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi,

On Wed, Jul 30, 2014 at 2:21 PM, <[hidden email]> wrote:
Hi Rashad,

If you're in the geometry code, note the below warning on infinite loop:

           //---
            // WARNING:
            // Must create/set the geometry at this point or the next call to
            // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
            // as it does a recursive call back to ossimImageHandler::getImageGeometry().
            //---
            if ( !theGeometry )
            {
               theGeometry = new ossimImageGeometry();
            }
Dave


I am not clear is this in the ossim code or in the library which uses OSSIM.  What I post as valgrind output is running simple ossim-info. Without geom it enters a different path but the problem with factoryclass's destructor not getting called exists. 

So to avoid memory issues I must have a .geom but even if I have a geom the static pointer not getting freed right?. This was a major no no to pass ossim over valgrind.

There are some other such  as initialization of char array noted in Oscar's reply

 




From: "Kramer, Oscar" <[hidden email]>
To: "Rashad M" <[hidden email]>, "David Burken" <[hidden email]>
Cc: "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 5:26:07 AM

Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi Rashad,

I'm looking over your changes. It seems the only change of consequence is moving the instance singleton pointer from being a static data member to being a class static defined in the cpp file. I don't see that making any difference though.

There is another change which I think is incorrect:
   char ecgTest[4];
   char ecgTest[4]= { '\0' };

It used to be
   char ecgTest[4];
   char ecgTest[3]= { '\0' };

which was correct.

The getImageGeometry() path in the absence of a geom file follows a very convoluted path. Try tracing through it to see if you're in an infinite recursion. I have seen that before. 

Oscar


From: Rashad M <[hidden email]>
To: David Burken <[hidden email]>
Cc: ossim users <[hidden email]>
Sent: Wednesday, July 30, 2014 4:45 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk


_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer






--
Regards,
   Rashad




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

David Burken
Hi Rashad,

We made an attempt at this a while back and had issues. Ended up backing out changes.  See below.  All memory is freed when the program exits.  It would be nice to make the valgrind spotless but I just don't have time right now.  You could do a ticket and we can address it later if you want.

Take care,
Dave
 
http://trac.osgeo.org/ossim/changeset/22655/trunk/ossim/src/ossim/base/ossimStreamFactory.cpp


On 07/30/2014 09:40 AM, Rashad M wrote:



On Wed, Jul 30, 2014 at 3:31 PM, <[hidden email]> wrote:
I thought you were in/editing the geometry code.  I think the valgrind thing is a false positive on the static instances.  When the app exits, the memory is returned to the heap.

Ok. When looking at valgrind and googling about singleton all pointed to use static variable instead of static pointer variable to leave the deallocation mess to compiler and calling a destructor may not be good enough in this case. 

So I thought its worth to check the current implementation.

Dave



From: "Rashad M" <[hidden email]>
To: "Mary Burken" <[hidden email]>
Cc: "Kramer, Oscar" <[hidden email]>, "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 8:50:43 AM

Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi,

On Wed, Jul 30, 2014 at 2:21 PM, <[hidden email]> wrote:
Hi Rashad,

If you're in the geometry code, note the below warning on infinite loop:

           //---
            // WARNING:
            // Must create/set the geometry at this point or the next call to
            // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
            // as it does a recursive call back to ossimImageHandler::getImageGeometry().
            //---
            if ( !theGeometry )
            {
               theGeometry = new ossimImageGeometry();
            }
Dave


I am not clear is this in the ossim code or in the library which uses OSSIM.  What I post as valgrind output is running simple ossim-info. Without geom it enters a different path but the problem with factoryclass's destructor not getting called exists. 

So to avoid memory issues I must have a .geom but even if I have a geom the static pointer not getting freed right?. This was a major no no to pass ossim over valgrind.

There are some other such  as initialization of char array noted in Oscar's reply

 




From: "Kramer, Oscar" <[hidden email]>
To: "Rashad M" <[hidden email]>, "David Burken" <[hidden email]>
Cc: "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 5:26:07 AM

Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi Rashad,

I'm looking over your changes. It seems the only change of consequence is moving the instance singleton pointer from being a static data member to being a class static defined in the cpp file. I don't see that making any difference though.

There is another change which I think is incorrect:
   char ecgTest[4];
   char ecgTest[4]= { '\0' };

It used to be
   char ecgTest[4];
   char ecgTest[3]= { '\0' };

which was correct.

The getImageGeometry() path in the absence of a geom file follows a very convoluted path. Try tracing through it to see if you're in an infinite recursion. I have seen that before. 

Oscar


From: Rashad M <[hidden email]>
To: David Burken <[hidden email]>
Cc: ossim users <[hidden email]>
Sent: Wednesday, July 30, 2014 4:45 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk






_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer






--
Regards,
   Rashad




--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

rashadkm
Hi David,


On Tue, Aug 5, 2014 at 2:22 AM, David Burken <[hidden email]> wrote:
Hi Rashad,

We made an attempt at this a while back and had issues. Ended up backing out changes.  See below.

In this change the staticInstance is not a static variable in the instance()  and rather a local variable. This for sure will end up with issues. In the patch I had given i had a static variable theInstace in the static method.  
 
  All memory is freed when the program exits. 

I had a simple test case for both the implementation address the leak issue with valgrind. Unfortunately I dont it with me right now. But I can recreate if required.

I dont understand how this memory got freed, How did you check? 

 
It would be nice to make the valgrind spotless but I just don't have time right now. 

You mean suppress the valgrind error or actually clear the leak?
 
You could do a ticket and we can address it later if you want.

Take care,
Dave
 
http://trac.osgeo.org/ossim/changeset/22655/trunk/ossim/src/ossim/base/ossimStreamFactory.cpp


On 07/30/2014 09:40 AM, Rashad M wrote:



On Wed, Jul 30, 2014 at 3:31 PM, <[hidden email]> wrote:
I thought you were in/editing the geometry code.  I think the valgrind thing is a false positive on the static instances.  When the app exits, the memory is returned to the heap.

Ok. When looking at valgrind and googling about singleton all pointed to use static variable instead of static pointer variable to leave the deallocation mess to compiler and calling a destructor may not be good enough in this case. 

So I thought its worth to check the current implementation.

Dave



From: "Rashad M" <[hidden email]>
To: "Mary Burken" <[hidden email]>
Cc: "Kramer, Oscar" <[hidden email]>, "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 8:50:43 AM

Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi,

On Wed, Jul 30, 2014 at 2:21 PM, <[hidden email]> wrote:
Hi Rashad,

If you're in the geometry code, note the below warning on infinite loop:

           //---
            // WARNING:
            // Must create/set the geometry at this point or the next call to
            // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
            // as it does a recursive call back to ossimImageHandler::getImageGeometry().
            //---
            if ( !theGeometry )
            {
               theGeometry = new ossimImageGeometry();
            }
Dave


I am not clear is this in the ossim code or in the library which uses OSSIM.  What I post as valgrind output is running simple ossim-info. Without geom it enters a different path but the problem with factoryclass's destructor not getting called exists. 

So to avoid memory issues I must have a .geom but even if I have a geom the static pointer not getting freed right?. This was a major no no to pass ossim over valgrind.

There are some other such  as initialization of char array noted in Oscar's reply

 




From: "Kramer, Oscar" <[hidden email]>
To: "Rashad M" <[hidden email]>, "David Burken" <[hidden email]>
Cc: "ossim" <[hidden email]>
Sent: Wednesday, July 30, 2014 5:26:07 AM

Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi Rashad,

I'm looking over your changes. It seems the only change of consequence is moving the instance singleton pointer from being a static data member to being a class static defined in the cpp file. I don't see that making any difference though.

There is another change which I think is incorrect:
   char ecgTest[4];
   char ecgTest[4]= { '\0' };

It used to be
   char ecgTest[4];
   char ecgTest[3]= { '\0' };

which was correct.

The getImageGeometry() path in the absence of a geom file follows a very convoluted path. Try tracing through it to see if you're in an infinite recursion. I have seen that before. 

Oscar


From: Rashad M <[hidden email]>
To: David Burken <[hidden email]>
Cc: ossim users <[hidden email]>
Sent: Wednesday, July 30, 2014 4:45 AM
Subject: Re: [OSSIM] ossim-info memory leak occurs for images without .geom

Hi David,

How about the attached patch for SensorModelFactory. But there are other *Factory classes with the similar instance method.

In the patch string initialization itself shows 0 errors from valgrind but I think a change to SensorModelFactory::instance is also needed



On Wed, Jul 30, 2014 at 2:10 AM, David Burken <[hidden email]> wrote:
Hi Mohammed,

Definitely take two different paths with/without geometry file.  The static factory instances always give us grief with valgrind.  Not sure how to fix it.  If you figure something out let us know...

Dave



On 07/29/2014 06:00 AM, Rashad M wrote:
Hi all,

I have a memory leak problem with ossim but if there is a geom file then it seems fine

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif

The above prints:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== Memcheck, a memory error detector
==22105== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22105== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22105== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22105== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14820.517849692,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.933382679497
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.933382679497
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14820.517849692
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  0
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22105== 
==22105== HEAP SUMMARY:
==22105==     in use at exit: 108,360 bytes in 2,128 blocks
==22105==   total heap usage: 6,492 allocs, 4,364 frees, 1,173,037 bytes allocated
==22105== 
==22105== LEAK SUMMARY:
==22105==    definitely lost: 1,808 bytes in 60 blocks
==22105==    indirectly lost: 302 bytes in 8 blocks
==22105==      possibly lost: 30,281 bytes in 877 blocks
==22105==    still reachable: 75,969 bytes in 1,183 blocks
==22105==         suppressed: 0 bytes in 0 blocks
==22105== Rerun with --leak-check=full to see details of leaked memory
==22105== 
==22105== For counts of detected and suppressed errors, rerun with: -v
==22105== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)


In the above case earth.geom exists.

ls ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.*
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.geom
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.jpg
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.ovr
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
/home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif.ovr


But in the case when I remove .geom file and run ossim-info on same dataset, I got:

valgrind ./Debug/ossim-info ~/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== Memcheck, a memory error detector
==22435== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==22435== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==22435== Command: ./Debug/ossim-info /home/rashad/code/ossim/ossim_trunk/ossim_package_support/images/reference/earth.tif
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A092F9: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A09308: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BF9D4: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B66A3: ossimString::ossimString(char const*) (in /home/rashad/build/ossim_/Debug/libossim.so.1.8.19)
==22435==    by 0x58CA277: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x4A0B1F1: bcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22435==    by 0x30C04BD942: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x30C04BD945: std::string::compare(std::string const&) const (in /usr/lib64/libstdc++.so.6.0.19)
==22435==    by 0x52B697B: ossimString::operator==(char const*) const (ossimString.h:243)
==22435==    by 0x58CA28D: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435== 
==22435== Conditional jump or move depends on uninitialised value(s)
==22435==    at 0x58CA2A3: ossimSensorModelFactory::createProjection(ossimFilename const&, unsigned int) const (ossimSensorModelFactory.cpp:366)
==22435==    by 0x58C685B: ossimProjectionFactoryBase::createProjection(ossimImageHandler*) const (ossimProjectionFactoryBase.cpp:108)
==22435==    by 0x58F09BC: ossimProjectionFactoryRegistry::createProjection(ossimImageHandler*) const (ossimProjectionFactoryRegistry.cpp:73)
==22435==    by 0x5670CDC: ossimImageGeometryFactory::createProjection(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:134)
==22435==    by 0x5670A19: ossimImageGeometryFactory::extendGeometry(ossimImageHandler*) const (ossimImageGeometryFactory.cpp:87)
==22435==    by 0x54968CB: ossimImageGeometryRegistry::extendGeometry(ossimImageHandler*) const (ossimImageGeometryRegistry.cpp:34)
==22435==    by 0x55FE316: ossimImageHandler::getImageGeometry() (ossimImageHandler.cpp:672)
==22435==    by 0x5AA9333: ossimInfo::getImageGeometryInfo(ossimImageHandler*, unsigned int, ossimKeywordlist&, bool) const (ossimInfo.cpp:1525)
==22435==    by 0x5AA916B: ossimInfo::getImageGeometryInfo(ossimImageHandler*, ossimKeywordlist&, bool) const (ossimInfo.cpp:1481)
==22435==    by 0x5AA90BE: ossimInfo::getImageGeometryInfo(ossimKeywordlist&, bool) (ossimInfo.cpp:1466)
==22435==    by 0x5AA6DC8: ossimInfo::executeImageOptions(ossimFilename const&) (ossimInfo.cpp:1038)
==22435==    by 0x5AA5B82: ossimInfo::execute() (ossimInfo.cpp:599)
==22435== 
image0.band0.max_value:  255
image0.band0.min_value:  1
image0.band0.null_value:  0
image0.band1.max_value:  255
image0.band1.min_value:  1
image0.band1.null_value:  0
image0.band2.max_value:  255
image0.band2.min_value:  1
image0.band2.null_value:  0
image0.driver:  ossim_tiff
image0.entry:  0
image0.geometry.decimal_degrees_per_pixel_lat:  0.133234641006662
image0.geometry.decimal_degrees_per_pixel_lon:  0.133283968900407
image0.geometry.decimations:  (1,1) (0.5,0.5) (0.25,0.25) (0.125,0.125) (0.0625,0.0625) (0.03125,0.03125) (0.015625,0.015625) (0.0078125,0.0078125) (0.00390625,0.00390625) (0.001953125,0.001953125)
image0.geometry.gsd:  (14815.032831983,14815.032831983)
image0.geometry.image_size:  (2701,1351)
image0.geometry.ll_lat:  -89.9333826794969
image0.geometry.ll_lon:  -179.93335801555
image0.geometry.lr_lat:  -89.9333826794969
image0.geometry.lr_lon:  179.933358015549
image0.geometry.meters_per_pixel_x:  14815.032831983
image0.geometry.meters_per_pixel_y:  14815.032831983
image0.geometry.projection.central_meridian:  0
image0.geometry.projection.datum:  WGE
image0.geometry.projection.elevation_lookup_flag:  0
image0.geometry.projection.ellipse_code:  WE
image0.geometry.projection.ellipse_epsg_code:  7030
image0.geometry.projection.ellipse_name:  WGS 84
image0.geometry.projection.false_easting_northing:  (0,0)
image0.geometry.projection.false_easting_northing_units:  meters
image0.geometry.projection.major_axis:  6378137
image0.geometry.projection.minor_axis:  6356752.3142
image0.geometry.projection.origin_latitude:  1.55886444994629
image0.geometry.projection.pcs_code:  4326
image0.geometry.projection.pixel_scale_units:  degrees
image0.geometry.projection.pixel_scale_xy:  (0.133283968900407,0.133234641006662)
image0.geometry.projection.srs_name:  EPSG:4326
image0.geometry.projection.tie_point_units:  degrees
image0.geometry.projection.tie_point_xy:  (-179.93335801555,89.9333826794967)
image0.geometry.projection.type:  ossimEquDistCylProjection
image0.geometry.target_rrds:  0
image0.geometry.tie_point_lat:  89.9333826794967
image0.geometry.tie_point_lon:  -179.93335801555
image0.geometry.type:  ossimImageGeometry
image0.geometry.ul_lat:  89.9333826794967
image0.geometry.ul_lon:  -179.93335801555
image0.geometry.ur_lat:  89.9333826794967
image0.geometry.ur_lon:  179.933358015549
image0.lr_x:  2700
image0.lr_y:  1350
image0.number_decimation_levels:  10
image0.number_input_bands:  3
image0.number_lines:  1351
image0.number_output_bands:  3
image0.number_samples:  2701
image0.overview.type:  ossimTiffTileSource
image0.radiometry:  8-bit
image0.type:  ossimTiffTileSource
image0.ul_x:  0
image0.ul_y:  0
number_entries:  1

==22435== 
==22435== HEAP SUMMARY:
==22435==     in use at exit: 108,360 bytes in 2,128 blocks
==22435==   total heap usage: 8,492 allocs, 6,364 frees, 4,292,384 bytes allocated
==22435== 
==22435== LEAK SUMMARY:
==22435==    definitely lost: 1,808 bytes in 60 blocks
==22435==    indirectly lost: 302 bytes in 8 blocks
==22435==      possibly lost: 30,281 bytes in 877 blocks
==22435==    still reachable: 75,969 bytes in 1,183 blocks
==22435==         suppressed: 0 bytes in 0 blocks
==22435== Rerun with --leak-check=full to see details of leaked memory
==22435== 
==22435== For counts of detected and suppressed errors, rerun with: -v
==22435== Use --track-origins=yes to see where uninitialised values come from
==22435== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 2 from 2)


I think this probably is coming from singleton class destructor not called in *Factory classes. 

Any idea?

--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk






_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk

_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer






--
Regards,
   Rashad




--
Regards,
   Rashad




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

Garrett Potts-2
Hello Rashad:


In this change the staticInstance is not a static variable in the instance()  and rather a local variable. This for sure will end up with issues. In the patch I had given i had a static variable theInstace in the static method.  


May need to try again.  That may have been a typo and that might have been a reason why there was a sporadic core dump when I tried to fix it way back when.  I was removing all global static instances and putting them within the method that creates the instance as a static variable within that method.  There were a lot of changes and there was a core dump occurring.  If I made that typo that you showed then that might have been the problem.

We might want to try again and just do a couple of them at a time and then test loads on all platforms. 


 
  All memory is freed when the program exits. 

I had a simple test case for both the implementation address the leak issue with valgrind. Unfortunately I dont it with me right now. But I can recreate if required.

I dont understand how this memory got freed, How did you check? 

In an application, once it terminates the OS pools the memory that was owned by the application.  So all those static instances should be pooled on terminiation.


 
It would be nice to make the valgrind spotless but I just don't have time right now. 

You mean suppress the valgrind error or actually clear the leak?


Clear all indicated leaks.


Take care

Garrett


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

rashadkm
Hello Garrett,


On Tue, Aug 5, 2014 at 1:07 PM, Garrett Potts <[hidden email]> wrote:
Hello Rashad:


In this change the staticInstance is not a static variable in the instance()  and rather a local variable. This for sure will end up with issues. In the patch I had given i had a static variable theInstace in the static method.  


May need to try again.  That may have been a typo and that might have been a reason why there was a sporadic core dump when I tried to fix it way back when.  I was removing all global static instances and putting them within the method that creates the instance as a static variable within that method.  There were a lot of changes and there was a core dump occurring.  If I made that typo that you showed then that might have been the problem.

We might want to try again and just do a couple of them at a time and then test loads on all platforms. 


Ok. If you could let me know when it is ready I can help with testing.
 
  All memory is freed when the program exits. 

I had a simple test case for both the implementation address the leak issue with valgrind. Unfortunately I dont it with me right now. But I can recreate if required.

I dont understand how this memory got freed, How did you check? 

In an application, once it terminates the OS pools the memory that was owned by the application.  So all those static instances should be pooled on terminiation.

Ok thats clear and sorry for the confusion I thought the profiler is saying its freed which was different in my case.

 
It would be nice to make the valgrind spotless but I just don't have time right now. 

You mean suppress the valgrind error or actually clear the leak?

This again is connected with my previous doubt but clear now...


Clear all indicated leaks.


Take care

Garrett




--
Regards,
   Rashad

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer
Reply | Threaded
Open this post in threaded view
|

Re: ossim-info memory leak occurs for images without .geom

David Burken
Hi,

There's still more to do but we fixed a bunch today if you do an svn update...

Dave

On 08/05/2014 02:09 PM, Rashad M wrote:
Hello Garrett,


On Tue, Aug 5, 2014 at 1:07 PM, Garrett Potts <[hidden email]> wrote:
Hello Rashad:


In this change the staticInstance is not a static variable in the instance()  and rather a local variable. This for sure will end up with issues. In the patch I had given i had a static variable theInstace in the static method.  


May need to try again.  That may have been a typo and that might have been a reason why there was a sporadic core dump when I tried to fix it way back when.  I was removing all global static instances and putting them within the method that creates the instance as a static variable within that method.  There were a lot of changes and there was a core dump occurring.  If I made that typo that you showed then that might have been the problem.

We might want to try again and just do a couple of them at a time and then test loads on all platforms. 


Ok. If you could let me know when it is ready I can help with testing.
 
  All memory is freed when the program exits. 

I had a simple test case for both the implementation address the leak issue with valgrind. Unfortunately I dont it with me right now. But I can recreate if required.

I dont understand how this memory got freed, How did you check? 

In an application, once it terminates the OS pools the memory that was owned by the application.  So all those static instances should be pooled on terminiation.

Ok thats clear and sorry for the confusion I thought the profiler is saying its freed which was different in my case.

 
It would be nice to make the valgrind spotless but I just don't have time right now. 

You mean suppress the valgrind error or actually clear the leak?

This again is connected with my previous doubt but clear now...


Clear all indicated leaks.


Take care

Garrett




--
Regards,
   Rashad


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
www.ossim.org
Ossim-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/ossim-developer