Discussion:
[omniORB] Memory leak when transferring a sequence of CORBA:Any ?
Goetz GAYCKEN
2007-01-26 21:38:10 UTC
Permalink
Hello everybody,

I am pretty much a novice, so maybe I am doing something utterly
wrong here.

I am trying to transfer a sequence of Anys. The transfer works
flawlessly in A). But, I experience a memory leak on the server side in
configuration. I haven't observed a memory leak in configuration B),
but floats get garbled during the transfer. The latter is a known
problem, in my understanding, that hasn't been fixed yet in debian.

Is something wrong in my code or is there a memory leak in 4.0.7 ?

Thanks in advance,

G?tz Gaycken


A)
scientific linux 4,
x86_64,
omniORB 4.0.7,
g++ version 3.4.6 20060404 (Red Hat 3.4.6-3)

B)
debian unstable,
x86,
omniorb 4.0.6-2.3,
g++ version 4.1.2 20061028 (debian 4.1.1-19)


// IDL
module AnyTest {

typedef sequence<any> AnyVec;

interface Provider {
AnyVec getSequence();
};
};

// C++
namespace AnyTest {

class Provider_impl : public POA_AnyTest::Provider,
public PortableServer::RefCountServantBase
{
public:
inline Provider_impl() {}
virtual ~Provider_impl() {}
AnyVec *getSequence();
};

AnyVec *Provider_impl::getSequence()
{
AnyVec_var any_vec=new AnyVec;
any_vec->length(100);
for (unsigned int i=0; i<any_vec->length(); i++) {
float val=i+.1;
( (any_vec[i]) <<= val);
}
return any_vec._retn();
}

}
Duncan Grisby
2007-02-05 23:55:21 UTC
Permalink
Post by Goetz GAYCKEN
I am trying to transfer a sequence of Anys. The transfer works
flawlessly in A). But, I experience a memory leak on the server side in
configuration. I haven't observed a memory leak in configuration B),
but floats get garbled during the transfer. The latter is a known
problem, in my understanding, that hasn't been fixed yet in debian.
Is something wrong in my code or is there a memory leak in 4.0.7 ?
Your code looks ok to me. How do you know it's leaking? Are you using a
tool like valgrind? If so, what does it tell you is leaking?

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...