Memory leak issue

Please post support and help requests here.
tnarol
Posts: 22
Joined: 21 Mar 2007, 18:56
Location: France

Memory leak issue

Postby tnarol » 23 May 2007, 13:46

Hi,

I'm dynamically linking under Visual Studio 7.1 with the following Poco libraries : Foundation, XML, Util

After running my program in debug mode, the debugger warns "Detected memory leaks!" and dumps objects. Among these objects I could find the following lines :

{119} normal block at 0x01645E50, 32 bytes long.
Data: <%Y-%m-%d %H:%M:%> 25 59 2D 25 6D 2D 25 64 20 25 48 3A 25 4D 3A 25
{118} normal block at 0x01645DF0, 32 bytes long.
Data: <%w %b %f %H:%M:%> 25 77 20 25 62 20 25 66 20 25 48 3A 25 4D 3A 25
{116} normal block at 0x016460D0, 32 bytes long.
Data: <%W, %e %b %y %H:> 25 57 2C 20 25 65 20 25 62 20 25 79 20 25 48 3A
{115} normal block at 0x01646070, 32 bytes long.
Data: <%W, %e-%b-%y %H:> 25 57 2C 20 25 65 2D 25 62 2D 25 79 20 25 48 3A
{114} normal block at 0x01646010, 32 bytes long.
Data: <%w, %d %b %Y %H:> 25 77 2C 20 25 64 20 25 62 20 25 59 20 25 48 3A
{113} normal block at 0x01645FB0, 32 bytes long.
Data: <%w, %e %b %Y %H:> 25 77 2C 20 25 65 20 25 62 20 25 59 20 25 48 3A
{112} normal block at 0x01645F50, 32 bytes long.
Data: <%w, %e %b %y %H:> 25 77 2C 20 25 65 20 25 62 20 25 79 20 25 48 3A
{111} normal block at 0x01645EF0, 32 bytes long.
Data: <%Y-%m-%dT%H:%M:%> 25 59 2D 25 6D 2D 25 64 54 25 48 3A 25 4D 3A 25
{110} normal block at 0x01645EB0, 4 bytes long.

It seems the text corresponds to the following lines in DateTimeFormat.cpp :

const std::string DateTimeFormat ::ISO8601_FORMAT = "%Y-%m-%dT%H:%M:%S%z";
const std::string DateTimeFormat ::RFC822_FORMAT = "%w, %e %b %y %H:%M:%S %Z";
const std::string DateTimeFormat ::RFC1123_FORMAT = "%w, %e %b %Y %H:%M:%S %Z";
const std::string DateTimeFormat ::HTTP_FORMAT = "%w, %d %b %Y %H:%M:%S %Z";
const std::string DateTimeFormat ::RFC850_FORMAT = "%W, %e-%b-%y %H:%M:%S %Z";
const std::string DateTimeFormat ::RFC1036_FORMAT = "%W, %e %b %y %H:%M:%S %Z";
const std::string DateTimeFormat ::ASCTIME_FORMAT = "%w %b %f %H:%M:%S %Y";
const std::string DateTimeFormat ::SORTABLE_FORMAT = "%Y-%m-%d %H:%M:%S";

After checking for obvious memory leaks I tried to remove every instanciation of Poco object from my program...but I still have these memory leaks. I noticed that other "const std::string" objects that I declared myself are also dumped as memory leaks.

Would you have a clue ?


guenter
Posts: 1186
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Memory leak issue

Postby guenter » 27 May 2007, 10:20

Seems that for some reason the destructors for static objects are not called. Check your project settings and compare them against the ones from the POCO sample projects. Also, how do you terminate your application? Calling TerminateProcess or ExitProcess might also prevent the destructors from being called.

tnarol
Posts: 22
Joined: 21 Mar 2007, 18:56
Location: France

Re: Memory leak issue

Postby tnarol » 30 May 2007, 16:07

Thanks,

I don't know if the application is terminated by TerminateProcess or ExitProcess. All I know is that I don't call them myself. I'll check the settings right now.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 0 guests

cron