[ 
https://issues.apache.org/jira/browse/TUSCANY-1552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Gentsch updated TUSCANY-1552:
------------------------------------

    Attachment: test.xml

valgrind:
Before:
========================
==16620== Memcheck, a memory error detector
==16620== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==16620== Using Valgrind-3.5.0-Debian and LibVEX; rerun with -h for copyright 
info
==16620== Command: ./testmlk
==16620== 
Creating datafactory ...
Creating xsd helper ...
Creating xml helper ...
Loading schema ...
Loading xml ...
Getting root sdo ...
Getting prop2 list ...
Release original sdo ...
Access prop2 list ...
List has 3 elements:
class2[0]: blub
class2[1]: blub2
class2[2]: blub3
All done.
==16620== 
==16620== HEAP SUMMARY:
==16620==     in use at exit: 7,042 bytes in 226 blocks
==16620==   total heap usage: 2,298 allocs, 2,072 frees, 163,324 bytes allocated
==16620== 
==16620== 6,504 (44 direct, 6,460 indirect) bytes in 1 blocks are definitely 
lost in loss record 142 of 142
==16620==    at 0x4025390: operator new(unsigned int) (vg_replace_malloc.c:214)
==16620==    by 0x40FF5C6: 
commonj::sdo::DataObjectImpl::getList(commonj::sdo::Property const&) 
(DataObjectImpl.cpp:765)
==16620==    by 0x40FF04B: commonj::sdo::DataObjectImpl::getList(std::string 
const&) (DataObjectImpl.cpp:726)
==16620==    by 0x40FEEC3: commonj::sdo::DataObjectImpl::getList(char const*) 
(DataObjectImpl.cpp:702)
==16620==    by 0x4136717: 
commonj::sdo::SDOSAX2Parser::setDO(commonj::sdo::RefCountingPointer<commonj::sdo::DataObject>,
 commonj::sdo::SDOXMLString&) (SDOSAX2Parser.cpp:233)
==16620==    by 0x413AD4D: 
commonj::sdo::SDOSAX2Parser::startElementNs(commonj::sdo::SDOXMLString const&, 
commonj::sdo::SDOXMLString const&, commonj::sdo::SDOXMLString const&, 
commonj::sdo::SAX2Namespaces const&, commonj::sdo::SAX2Attributes const&) 
(SDOSAX2Parser.cpp:1057)
==16620==    by 0x412EAE1: sdo_startElementNs(void*, unsigned char const*, 
unsigned char const*, unsigned char const*, int, unsigned char const**, int, 
int, unsigned char const**) (SAX2Parser.cpp:237)
==16620==    by 0x44A2262: ??? (in /usr/lib/libxml2.so.2.7.5)
==16620==    by 0x44A2EC9: xmlParseElement (in /usr/lib/libxml2.so.2.7.5)
==16620==    by 0x44A3439: xmlParseContent (in /usr/lib/libxml2.so.2.7.5)
==16620==    by 0x44A2F4B: xmlParseElement (in /usr/lib/libxml2.so.2.7.5)
==16620==    by 0x44AA291: xmlParseDocument (in /usr/lib/libxml2.so.2.7.5)
==16620== 
==16620== LEAK SUMMARY:
==16620==    definitely lost: 44 bytes in 1 blocks
==16620==    indirectly lost: 6,460 bytes in 205 blocks
==16620==      possibly lost: 0 bytes in 0 blocks
==16620==    still reachable: 538 bytes in 20 blocks
==16620==         suppressed: 0 bytes in 0 blocks
==16620== Reachable blocks (those to which a pointer was found) are not shown.
==16620== To see them, rerun with: --leak-check=full --show-reachable=yes
==16620== 
==16620== For counts of detected and suppressed errors, rerun with: -v
==16620== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 25 from 6)
========================


After:
========================
==16623== Memcheck, a memory error detector
==16623== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==16623== Using Valgrind-3.5.0-Debian and LibVEX; rerun with -h for copyright 
info
==16623== Command: ./testmlk
==16623== 
Creating datafactory ...
Creating xsd helper ...
Creating xml helper ...
Loading schema ...
Loading xml ...
Getting root sdo ...
Getting prop2 list ...
Release original sdo ...
Access prop2 list ...
List has 3 elements:
class2[0]: blub
class2[1]: blub2
class2[2]: blub3
All done.
==16623== 
==16623== HEAP SUMMARY:
==16623==     in use at exit: 538 bytes in 20 blocks
==16623==   total heap usage: 2,298 allocs, 2,278 frees, 163,324 bytes allocated
==16623== 
==16623== LEAK SUMMARY:
==16623==    definitely lost: 0 bytes in 0 blocks
==16623==    indirectly lost: 0 bytes in 0 blocks
==16623==      possibly lost: 0 bytes in 0 blocks
==16623==    still reachable: 538 bytes in 20 blocks
==16623==         suppressed: 0 bytes in 0 blocks
==16623== Reachable blocks (those to which a pointer was found) are not shown.
==16623== To see them, rerun with: --leak-check=full --show-reachable=yes
==16623== 
==16623== For counts of detected and suppressed errors, rerun with: -v
==16623== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 25 from 6)
========================

> Severe memory leak in DataObjectImpl.
> -------------------------------------
>
>                 Key: TUSCANY-1552
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1552
>             Project: Tuscany
>          Issue Type: Bug
>          Components: C++ SDO
>    Affects Versions: Cpp-M3
>         Environment: All
>            Reporter: Albert Krzymowski
>             Fix For: Java-SDO-Next
>
>         Attachments: DataObjectImpl.cpp-PATCH, schema1.xsd, test.xml, 
> testmlk.cpp
>
>
> Memory leak in DataObjectImpl:
> the private listValue member is never:
>  initialized, deleted, and copied properly in coping constructors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to