[omniORB] Memory leak in CORBA any
David Hyde
davidh@cavendish.co.uk
Tue, 26 Mar 2002 15:59:41 -0000
Dmitry,
Thanks for the response.
I'm certainly building against the correct omniORB libraries. I've looked
at the dependency listings for my app and both msvcrt.dll and msvcrtd.dll
are listed for the debug build. For the release build only msvcrt.dll is
listed. Then I looked at the dependency listing for the dlls that my app
uses and both omniDynamic304_rtd.dll and omniORB304_rtd.dll use msvcrt.dll
and msvcrtd.dll which a couple of the Microsoft libraries do as well.
Therefore I don't believe that I can get rid of this. However, I get a
memory leak in the release build, so I don't think that this is the problem.
You say that you don't link to msvcstub.lib. If I leave this out then the
app falls over after the first couple of messages are received. Are you
building with MSVC++? I remember reading that this library is required for
building with MSVC++ which is why I use it. If I leave msvcstubd.lib from
the debug build then it falls over quite quickly as well.
That is as far as my test application goes. I then rebuilt my own, large
distributed system without msvcstub.lib and ran the release build. All
seems to be ok (including memory usage) at the moment, but I would like to
see some official clarification of when msvcstub and msvcstubd are required.
I'm intending to move to omniORB 4 when it is released, but in the mean time
I really have to get this working. I'm interested to see if Duncan or
another of the omniORB team take an interest in this thread particularly
with reference to the msvcstub issue that I seem to have.
Thanks
David
-----Original Message-----
From: Dmitry Yurtaev [mailto:dmitry@channel4.ru]
Sent: 26 March 2002 15:02
To: David Hyde
Cc: omniorb-list@uk.research.att.com
Subject: Re: [omniORB] Memory leak in CORBA any
> Yesterday I sent a message about a leak that I was getting when receiving
> CORBA::any, but only in the release build of my app. Unfortunately there
> were no replies.
make sure you link with correct libs. for debug build they should be
omni???_rtd.lib
and for release
omni???_rt.lib
your situation can be if you link you code with MSVCRT.dll and the ORB uses
MSVCRTD.dll or vice versa. they have different versions of malloc()/free()
functions, so memory allocated by new operator in your code isn't free()'ed
if destructor is called by the ORB.
that's what i use in makefiles:
LDFLAGS = \
-nologo -release -pdb:none \
-libpath:$(OMNIHOME)\lib\x86_win32 \
-nodefaultlib:libcmt.lib -nodefaultlib:libcmtd.lib \
advapi32.lib ws2_32.lib mswsock.lib \
omniORB400_rt.lib omniDynamic400_rt.lib omnithread30_rt.lib
CCFLAGS = \
-nologo -MD -GX \
-D__OMNIORB4__ -D__WIN32__ -D_WIN32_WINNT=0x0400 \
-D__x86__ -D__NT__ -D__OSVERSION__=4 \
-I $(OMNIHOME)\include
i've had a similar problem but in both release and debug builds. problem
gone when i removed msvcstub.lib from linking args (still don't know what is
it for).
/Dmitry