[omniORB] Memory leak when transferring a sequence of CORBA:Any ?

Goetz GAYCKEN goetz.gaycken at cern.ch
Fri Jan 26 16:37:47 GMT 2007


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();
  }

}







More information about the omniORB-list mailing list